-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.21 KB
/
patch-on-merge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Patch on merged PR
on:
pull_request:
types: [closed]
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.labels[0].name == 'dependencies' && github.event.pull_request.merged == true
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: set remote url
run: |
git remote set-url --push origin https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git checkout "$GITHUB_REF"
- name: Patch version
run: |
git config --global user.email "[email protected]"
git config --global user.name "$GITHUB_ACTOR"
npm version patch
- name: Set up Node.js for NPM
uses: actions/[email protected]
with:
registry-url: 'https://registry.npmjs.org'
node-version: '10.x'
- name: Install dependencies
run: npm ci
- name: Git push
run: |
git push origin
git push origin --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish package to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}