Skip to content

Commit 85d6a0a

Browse files
authored
Merge pull request #57 from layer5io/aabidsofi19-patch-1
Update build-and-release.yml
2 parents e161335 + 95b3ad2 commit 85d6a0a

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/build-and-release.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,35 @@ on:
2121
- README.md
2222

2323
jobs:
24+
25+
short-circuit:
26+
runs-on: ubuntu-latest
27+
outputs:
28+
should_skip: ${{ steps.check.outputs.should_skip }}
29+
steps:
30+
- name: Check if workflow should be skipped
31+
id: check
32+
run: |
33+
echo "Commit message: ${{ github.event.head_commit.message }}"
34+
echo "Actor: ${{ github.actor }}"
35+
36+
# Check for [skip ci] in commit message or actor
37+
if [[ "${{ github.actor }}" == "auto-pusher" ]] || [[ "${{ github.event.head_commit.message }}" == *"[skip ci]"* ]]; then
38+
echo "should_skip=true" >> $GITHUB_OUTPUT
39+
else
40+
echo "should_skip=false" >> $GITHUB_OUTPUT
41+
fi
42+
2443
build-artifacts:
2544
runs-on: ubuntu-22.04
45+
if: needs.short-circuit.outputs.should_skip == 'false'
2646

2747
steps:
2848
- name: Checkout
2949
uses: actions/checkout@v4
3050
with:
3151
ref: 'master'
52+
token: ${{ secrets.GH_ACCESS_TOKEN }}
3253

3354
- name: Setup Hugo (Extended)
3455
uses: peaceiris/actions-hugo@v2
@@ -62,7 +83,7 @@ jobs:
6283

6384
- uses: stefanzweifel/git-auto-commit-action@v5
6485
with:
65-
commit_message: Build Academy
86+
commit_message: "Build Academy [skip ci]"
6687
commit_options: '--signoff'
6788
branch: master
6889
commit_user_name: l5io

0 commit comments

Comments
 (0)