fix: pin Publish preview on netlify artifact download to the triggering run - #3193
Open
gtrivedi88 wants to merge 1 commit into
Open
gtrivedi88 wants to merge 1 commit into
gtrivedi88 wants to merge 1 commit into
Conversation
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>
gtrivedi88
requested review from
a team,
deerskindoll and
mkuznyetsov
as code owners
September 17, 2026 06:27
|
⚡️ Deploying pull request preview... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this pull request change?
The
Publish preview on netlifyworkflow (.github/workflows/publish-netlify.yml) downloads thedoc-contentartifact from theBuild and validate pull requestrun that triggered it, viadawidd6/action-download-artifact. The step only specifiedworkflow, notrun_id:Without
run_id, the action searches for the most recent successfuldoc-contentartifact for that workflow name across the whole repo, not the specific run that triggered thisworkflow_runevent.allow_forksalso defaults tofalse, 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 (
createdAtstayed 2026-09-09 while the body kept changing, since GitHub doesn't bumpcreatedAton comment edits).Evidence:
number: 3192and posted there insteadnumber: 3143, confirming this is a race condition, not a permanent failureFix
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.allow_forks: true. This is safe here becausepublish-netlify.ymlalready runs viaworkflow_runin 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
Made with Cursor