-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Do not wait for code checks on release if the head commit skips CI (
#948)
- Loading branch information
Showing
1 changed file
with
13 additions
and
1 deletion.
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,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 }} | ||
|