-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Fix wait-on-check-action usage (#730)
Co-authored-by: Martin Adámek <[email protected]>
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 }} | ||
|