Skip to content

Commit 1b214eb

Browse files
committed
chore: don't release again if the commit contained a release
1 parent 1806540 commit 1b214eb

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,28 @@ on:
99
- completed
1010

1111
jobs:
12-
release:
12+
check-commit:
1313
runs-on: ubuntu-latest
1414
if: ${{ github.event.workflow_run.conclusion == 'success' }}
15+
outputs:
16+
skip: ${{ steps.commit-message.outputs.skip }}
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Get commit message
22+
id: commit-message
23+
run: |
24+
MESSAGE=$(git log --format=%B -n 1 $(git log -1 --pretty=format:"%h"))
25+
26+
if [[ $MESSAGE == "chore: release "* ]]; then
27+
echo "skip=true" >> $GITHUB_OUTPUT
28+
fi
29+
30+
release:
31+
runs-on: ubuntu-latest
32+
needs: check-commit
33+
if: ${{ needs.check-commit.outputs.skip != 'true' }}
1534
steps:
1635
- name: Checkout
1736
uses: actions/checkout@v3

0 commit comments

Comments
 (0)