-
Notifications
You must be signed in to change notification settings - Fork 133
36 lines (31 loc) · 1.15 KB
/
check-release-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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 --format=%s)" >> $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 0
fi
trigger-release-build:
needs: check-commit-message
if: needs.check-commit-message.outputs.trigger_release == 'true'
uses: ./.github/workflows/release-build.yml