Skip to content

Commit

Permalink
ci: Fix wait-on-check-action usage (#730)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Adámek <[email protected]>
  • Loading branch information
janbuchar and B4nan authored Jan 16, 2025
1 parent 16372cd commit 97e57c8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,26 @@ jobs:
custom_version: ${{ inputs.custom_version }}
existing_changelog_path: CHANGELOG.md

# 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 97e57c8

Please sign in to comment.