Skip to content

Commit 7c70c5f

Browse files
committed
ci: Bugfix for per-commit CI
Since github will take the definition of the workflow from the merge commit, we need to take the .ci scripts from there as well. If we check out the .ci scripts from the current commit it might not match the workflow definition.
1 parent 8b0d8a0 commit 7c70c5f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/pr-ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ jobs:
5858
GIT_COMMITTER_NAME: Bot
5959
GIT_COMMITTER_EMAIL: bot@bitbox.swiss
6060
run: |
61-
git fetch origin ${{ matrix.commit }}
61+
git fetch origin ${{ matrix.commit }} ${{ github.event.pull_request.merge_commit_sha }}
6262
git merge --no-ff --no-edit ${{ matrix.commit }}
63-
echo "merge commit parents:"
6463
git log -1 --format="Head %H, Parents %P"
64+
# Since the workflow definition is taken from the pull request merge commit, we need to
65+
# get the .ci scripts from there as well.
66+
git checkout -f ${{ github.event.pull_request.merge_commit_sha }} -- .ci .github
6567
6668
- name: Pull container image
6769
run: ./.ci/run-container-ci pull

0 commit comments

Comments
 (0)