Skip to content

Commit

Permalink
ci: modify the conditions for skipping construction
Browse files Browse the repository at this point in the history
 - On the basis of checking that the submitted message contains [skip], add a check for branch names
 - If the submitted message contains [skip] or the current branch is master, skip the build
  • Loading branch information
Suisuroru committed Feb 3, 2025
1 parent 34dc05e commit 55ab477
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/auto_build_jar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check if commit message contains [skip]
- name: Check if commit message contains [skip] and if branch is master
id: check_skip
if: env.SKIP_BUILD == 'false'
run: |
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
if [[ "$COMMIT_MESSAGE" == "[skip]"* ]]; then
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
if [[ "$COMMIT_MESSAGE" == "[skip]"* || "$BRANCH_NAME" == "master" ]]; then
echo "SKIP_RELEASE=true" >> $GITHUB_ENV
else
echo "SKIP_RELEASE=false" >> $GITHUB_ENV
Expand Down

0 comments on commit 55ab477

Please sign in to comment.