···17 This is a temporary commit that GitHub creates automatically as "what would happen, if this PR was merged into the base branch now?".
18 The checkout could be done via the virtual branch `refs/pull/<pr-number>/merge`, but doing so would cause failures when this virtual branch doesn't exist (anymore).
19 This can happen when the PR has conflicts, in which case the virtual branch is not created, or when the PR is getting merged while workflows are still running, in which case the branch won't exist anymore at the time of checkout.
20- Thus, we use the `get-merge-commit.yml` workflow to check whether the PR is mergeable and the test merge commit exists and only then run the relevant jobs.
2122- Various workflows need to make comparisons against the base branch.
23 In this case, we checkout the parent of the "test merge commit" for best results.
···17 This is a temporary commit that GitHub creates automatically as "what would happen, if this PR was merged into the base branch now?".
18 The checkout could be done via the virtual branch `refs/pull/<pr-number>/merge`, but doing so would cause failures when this virtual branch doesn't exist (anymore).
19 This can happen when the PR has conflicts, in which case the virtual branch is not created, or when the PR is getting merged while workflows are still running, in which case the branch won't exist anymore at the time of checkout.
20+ Thus, we use the `prepare` job to check whether the PR is mergeable and the test merge commit exists and only then run the relevant jobs.
2122- Various workflows need to make comparisons against the base branch.
23 In this case, we checkout the parent of the "test merge commit" for best results.
+4-5
.github/workflows/build.yml
···47 - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
48 with:
49 sparse-checkout: .github/actions
50- - name: Check if the PR can be merged and checkout the merge commit
51- uses: ./.github/actions/get-merge-commit
52 with:
53- mergedSha: ${{ inputs.mergedSha }}
54- merged-as-untrusted: true
55- pinnedFrom: untrusted
5657 - uses: cachix/install-nix-action@fc6e360bedc9ee72d75e701397f0bb30dce77568 # v31
58 with: