Skip to content

Commit 97e57c8

Browse files
janbucharB4nan
andauthored
ci: Fix wait-on-check-action usage (#730)
Co-authored-by: Martin Adámek <[email protected]>
1 parent 16372cd commit 97e57c8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/release.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,26 @@ jobs:
4343
custom_version: ${{ inputs.custom_version }}
4444
existing_changelog_path: CHANGELOG.md
4545

46+
# If github.ref points to a [skip ci] commit, we assume that it was added by the pre_release workflow,
47+
# which doesn't push the commit if code checks don't pass.
48+
# Otherwise, the checks will have been triggered by the `run_code_checks` workflow.
4649
wait_for_checks:
4750
name: Wait for code checks to pass
4851
runs-on: ubuntu-latest
4952
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v4
55+
- name: Check if the head commit contains [skip ci]
56+
id: check_skip
57+
run: |
58+
if git log --format=%B -n 1 ${{ github.sha }} | head -n 1 | grep '\[skip ci\]$'; then
59+
echo 'skipped=true' >> $GITHUB_OUTPUT
60+
else
61+
echo 'skipped=false' >> $GITHUB_OUTPUT
62+
fi
63+
5064
- uses: lewagon/[email protected]
65+
if: ${{ steps.check_skip.outputs.skipped == 'false' }}
5166
with:
5267
ref: ${{ github.ref }}
5368
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)