Skip to content

fix: pin Publish preview on netlify artifact download to the triggering run - #3193

Open
gtrivedi88 wants to merge 1 commit into
eclipse-che:mainfrom
gtrivedi88:fix-preview-netlify-artifact-race
Open

gtrivedi88 wants to merge 1 commit into
eclipse-che:mainfrom
gtrivedi88:fix-preview-netlify-artifact-race

Conversation

@gtrivedi88

Copy link
Copy Markdown
Contributor

What does this pull request change?

The Publish preview on netlify workflow (.github/workflows/publish-netlify.yml) downloads the doc-content artifact from the Build and validate pull request run that triggered it, via dawidd6/action-download-artifact. The step only specified workflow, not run_id:

- name: Download doc-content artifact
  uses: dawidd6/action-download-artifact@...
  with:
    workflow: ${{ github.event.workflow_run.workflow_id }}
    name: doc-content
    path: content

Without run_id, the action searches for the most recent successful doc-content artifact for that workflow name across the whole repo, not the specific run that triggered this workflow_run event. allow_forks also defaults to false, which causes the search to skip fork-originated PR runs — and every JTBD PR is opened from a fork.

Observed impact

On #3143, multiple concurrently-building fork PRs (#3143, #3151, #3153, #3155) never received their own preview link. Instead, the "🎊 Navigate the preview" comment kept landing on #3192 — a same-repo (non-fork) branch push whose sticky comment was repeatedly overwritten with unrelated deploy links throughout the day (createdAt stayed 2026-09-09 while the body kept changing, since GitHub doesn't bump createdAt on comment edits).

Evidence:

Fix

  • Pin run_id: ${{ github.event.workflow_run.id }} so the artifact download always resolves to the exact run that completed and triggered this workflow, removing the ambiguous repo-wide search entirely.
  • Set allow_forks: true. This is safe here because publish-netlify.yml already runs via workflow_run in the base repo's trusted context (that split from the build workflow is exactly why this two-workflow pattern exists) — we're only reading a previously-built static-site artifact, not executing fork code.

What issues does this pull request fix or reference?

Fixes intermittent/missing preview links reported on #3143.

Specify the version of the product this pull request applies to

next

Pull Request checklist

  • No procedure changes — CI workflow fix only.
  • No page or link rename.
  • N/A — no content changes to validate with vale.

Made with Cursor

The dawidd6/action-download-artifact step in this workflow only
specified 'workflow', not 'run_id'. Without run_id, the action
searches for the most recent successful 'doc-content' artifact for
that workflow name across the entire repository instead of the
specific run that triggered this workflow_run event.

allow_forks defaults to false, which additionally causes the search
to skip fork-originated PR runs (every JTBD PR is opened from a
fork). The net effect: preview links for fork PRs get attributed to
whatever non-fork branch happens to have the most recent successful
build, instead of the PR that actually triggered the workflow.

Observed on PR eclipse-che#3143: multiple concurrently-building fork PRs
(eclipse-che#3143, eclipse-che#3151, eclipse-che#3153, eclipse-che#3155) never received their own preview link;
the '"Navigate the preview"' comment kept landing on PR eclipse-che#3192
(a same-repo branch push) instead, whose sticky comment was
repeatedly overwritten with unrelated deploy links throughout the
day (createdAt stayed 2026-09-09 while the body kept changing).

Fix: pin run_id to github.event.workflow_run.id so the artifact
download always resolves to the exact run that completed, and set
allow_forks: true since this workflow already executes in the base
repo's trusted context via workflow_run.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

Click here to review and test in web IDE: Contribute

@github-actions

Copy link
Copy Markdown

⚡️ Deploying pull request preview...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant