Skip to content

Commit a6ba1b0

Browse files
authored
Fix auto-deployment
1 parent 97e4f39 commit a6ba1b0

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

.github/workflows/npm-publish.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
1-
# Collaborators can publish a new version **of what's on master** by leaving a review on any PR, generally the PR that just closed.
2-
# To trigger this, the comment must match the format `🚀 version`, where "version" is anything accepted by `npm version XXX`
1+
# Collaborators can publish a new version of what's on master via "workflow_dispatch"
2+
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
33

44
name: Publish
55

66
on:
7-
pull_request_review:
8-
types:
9-
- submitted
7+
workflow_dispatch:
8+
inputs:
9+
Version:
10+
description: "Version, anything accepted by `npm version XXX`"
11+
required: true
1012

1113
jobs:
12-
1314
npm:
1415
runs-on: ubuntu-latest
15-
if: contains('OWNER,COLLABORATOR', github.event.review.author_association) && startsWith(github.event.review.body, '🚀')
1616
steps:
1717
- uses: actions/checkout@v2
18-
with:
19-
ref: master
2018
- run: npm install
2119
- uses: fregante/setup-git-token@v1
2220
with:
2321
token: ${{ secrets.GITHUB_TOKEN }}
24-
- name: npm version
25-
run: |
26-
WORDS=($COMMENT)
27-
npm version ${WORDS[1]}
28-
env:
29-
COMMENT: ${{ github.event.review.body }}
30-
- run: npm publish
31-
env:
32-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
22+
- run: npm version ${{ github.event.inputs.Version }}
23+
- uses: JS-DevTools/npm-publish@v1
24+
with:
25+
token: ${{ secrets.NPM_TOKEN }}
3326
- run: git push --follow-tags

0 commit comments

Comments
 (0)