-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: trigger the release build automatically
- Loading branch information
1 parent
43ffcee
commit 3dff054
Showing
2 changed files
with
38 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## If the latest commit message contains '[ci] release main', trigger release-build.yml | ||
name: Check Commit Message | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-commit-message: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
trigger_release: ${{ steps.check_commit_message.outputs.trigger_release }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get commit message | ||
id: get_commit_message | ||
run: echo "message=$(git log -1 --pretty=%B)" >> $GITHUB_OUTPUT | ||
|
||
- name: Check commit message | ||
id: check_commit_message | ||
run: | | ||
if [[ "${{ steps.get_commit_message.outputs.message }}" == *"[ci] release main"* ]]; then | ||
echo "Commit message contains '[ci] release main', triggering release build..." | ||
echo "trigger_release=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "Commit message does not contain '[ci] release main', skipping release build..." | ||
exit 1 | ||
fi | ||
trigger-release-build: | ||
needs: check-commit-message | ||
if: needs.check-commit-message.outputs.trigger_release == 'true' | ||
uses: ./.github/workflows/release-build.yml |
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