Build PR tooling from the base branch tip, not the event's base sha
github.event.pull_request.base.sha is a snapshot taken when the PR was last pushed, not the current tip of the base branch. A reopened or rerun PR therefore builds with whatever master looked like at its last push, and a tooling fix that landed on master since then never reaches it: the daily sync PR reopened after #553 merged checked out a base without helpers/artifact-helpers.sh and failed at "Pack artifact". Check out base.ref instead. The plan's diff and the empty-PR check still compare base.sha to head.sha, so the list of changed packages is unaffected; only the tooling that runs on the droplet moves to the tip.
This commit is contained in:
1 parent
30e862935e
commit
2c22669d65
1 file changed
+8
-4
@@ -38,11 +38,11 @@ jobs:
|
|||||||
vouch_status: ${{ steps.vouch.outputs.status }}
|
vouch_status: ${{ steps.vouch.outputs.status }}
|
||||||
empty: ${{ steps.list.outputs.empty }}
|
empty: ${{ steps.list.outputs.empty }}
|
||||||
steps:
|
steps:
|
||||||
# Same rule as the build job: bin/build-matrix comes from base, the
|
# Same rule as the build job: bin/build-matrix comes from the base
|
||||||
# package directories from the PR head.
|
# branch tip, the package directories from the PR head.
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.base.sha || github.sha }}
|
ref: ${{ github.event.pull_request.base.ref || github.sha }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- if: github.event_name == 'pull_request'
|
- if: github.event_name == 'pull_request'
|
||||||
@@ -146,9 +146,13 @@ jobs:
|
|||||||
# gets built, never how the runner builds it. A PR that changes both
|
# gets built, never how the runner builds it. A PR that changes both
|
||||||
# tooling and a package builds the package with the OLD tooling; land
|
# tooling and a package builds the package with the OLD tooling; land
|
||||||
# the tooling first. workflow_dispatch has no PR and runs as checked out.
|
# the tooling first. workflow_dispatch has no PR and runs as checked out.
|
||||||
|
# The base branch tip, not the event's base.sha: that sha is a snapshot
|
||||||
|
# taken at the PR's last push, so a tooling fix on master would never
|
||||||
|
# reach an open PR until someone pushed to it (seen on the daily sync
|
||||||
|
# PR after the artifact packing fix landed).
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.base.sha || github.sha }}
|
ref: ${{ github.event.pull_request.base.ref || github.sha }}
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Overlay the PR's package directories onto base tooling
|
- name: Overlay the PR's package directories onto base tooling
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
|
|||||||
Reference in new issue
Block a user