File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 4
4
push :
5
5
branches :
6
6
- main
7
+ workflow_dispatch :
7
8
8
9
concurrency : ${{ github.workflow }}-${{ github.ref }}
9
10
@@ -15,38 +16,39 @@ jobs:
15
16
steps :
16
17
- name : Check out repository
17
18
uses : actions/checkout@v4
18
-
19
+
19
20
- name : Setup PNPM
20
21
uses : pnpm/action-setup@v4
21
-
22
+
22
23
- name : Setup Node.js
23
24
uses : actions/setup-node@v4
24
25
with :
25
26
node-version : 20
26
27
cache : ' pnpm'
27
-
28
+
28
29
- name : Install dependencies
29
30
run : pnpm install --frozen-lockfile
30
-
31
+
31
32
- name : Check for unreleased changesets
32
33
id : has-changesets
33
34
uses : andstor/file-existence-action@v2
34
35
with :
35
36
files : " .changeset/!(README).md"
36
-
37
+
37
38
# If there are unreleased changesets, validate the project before creating the changesets PR
38
39
- name : Require build, test and lint to pass
39
40
if : steps.has-changesets.outputs.files_exists == 'true'
40
41
run : |
41
42
pnpm build
42
43
pnpm test
43
44
pnpm lint
44
-
45
+
45
46
# Run changesets action either if there are unreleased changesets (= a PR must be created)
46
47
# or if the commit message matches the release PR (= new versions must be published to NPM)
48
+ # or if the workflow was triggered manually through `workflow_dispatch`
47
49
- name : Create changesets PR or publish to NPM
48
50
id : changesets
49
- if : steps.has-changesets.outputs.files_exists == 'true' || startsWith(github.event.head_commit.message, '[CI] Release')
51
+ if : steps.has-changesets.outputs.files_exists == 'true' || startsWith(github.event.head_commit.message, '[CI] Release') || github.event_name == 'workflow_dispatch'
50
52
uses : changesets/action@v1
51
53
with :
52
54
title : ' [CI] Release'
You can’t perform that action at this time.
0 commit comments