Skip to content

Commit 3dffdca

Browse files
authored
ci: Do not wait for code checks on release if the head commit skips CI (apify#948)
1 parent 3d647d3 commit 3dffdca

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/release.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,26 @@ jobs:
4343
custom_version: ${{ inputs.custom_version }}
4444
existing_changelog_path: CHANGELOG.md
4545

46-
# If github.ref points to a [ci skip] commit, we assume that it was added by the pre_release workflow,
46+
# If github.ref points to a [skip ci] commit, we assume that it was added by the pre_release workflow,
4747
# which doesn't push the commit if code checks don't pass.
4848
# Otherwise, the checks will have been triggered by the `run_code_checks` workflow.
4949
wait_for_checks:
5050
name: Wait for code checks to pass
5151
runs-on: ubuntu-latest
5252
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+
5364
- uses: lewagon/[email protected]
65+
if: ${{ steps.check_skip.outputs.skipped == 'false' }}
5466
with:
5567
ref: ${{ github.ref }}
5668
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)