Skip to content

Commit e16da9e

Browse files
committed
check name [prerelease]
1 parent 34ea878 commit e16da9e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/prerelease.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ on:
88

99
jobs:
1010
prerelease:
11-
if: "github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '[prerelease]')"
11+
if: "contains(github.event.head_commit.message, '[prerelease]')"
1212
runs-on: ubuntu-latest
1313
env:
1414
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
1515
steps:
1616
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
19+
- name: Skip if commit message does not contain [prerelease]
20+
run: |
21+
[[ $(git show -s --format=%s) == *"[prerelease]"* ]] && echo "No prerelease needed" && exit 0 || echo "Continuing to prerelease"
1922
- uses: ./.github/actions/setup
2023
with:
2124
npm_token: ${{secrets.npm_token}}
@@ -24,7 +27,7 @@ jobs:
2427
id: changed-packages
2528
run: |
2629
changed_packages=$(yarn -s lerna ls --since=origin/master --json --loglevel=error)
27-
[[ $changed_packages = "[]" ]] && echo "No packages changed in this branch" && exit 1 || echo "Continuing to prerelease"
30+
[[ $changed_packages = "[]" ]] && echo "No packages changed in this branch" && exit 0 || echo "Continuing to prerelease"
2831
- name: Build all affected packages
2932
run: yarn lerna run build --since=origin/master
3033
- name: Generate prerelease prefix

0 commit comments

Comments
 (0)