Skip to content

Commit

Permalink
ci: Do not wait for code checks on release if the head commit skips CI (
Browse files Browse the repository at this point in the history
  • Loading branch information
janbuchar authored Jan 31, 2025
1 parent 3d647d3 commit 3dffdca
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,26 @@ jobs:
custom_version: ${{ inputs.custom_version }}
existing_changelog_path: CHANGELOG.md

# If github.ref points to a [ci skip] commit, we assume that it was added by the pre_release workflow,
# If github.ref points to a [skip ci] commit, we assume that it was added by the pre_release workflow,
# which doesn't push the commit if code checks don't pass.
# Otherwise, the checks will have been triggered by the `run_code_checks` workflow.
wait_for_checks:
name: Wait for code checks to pass
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check if the head commit contains [skip ci]
id: check_skip
run: |
if git log --format=%B -n 1 ${{ github.sha }} | head -n 1 | grep '\[skip ci\]$'; then
echo 'skipped=true' >> $GITHUB_OUTPUT
else
echo 'skipped=false' >> $GITHUB_OUTPUT
fi
- uses: lewagon/[email protected]
if: ${{ steps.check_skip.outputs.skipped == 'false' }}
with:
ref: ${{ github.ref }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 3dffdca

Please sign in to comment.