@@ -2,6 +2,19 @@ name: Node CI
22
33on : [push]
44
5+ # Enabled permissions on GITHUB_TOKEN
6+ permissions :
7+ # To be able to push to the repo
8+ contents : write
9+ # To update the pr description with canary info
10+ pull-requests : write
11+ # For pr-check to create a status
12+ statuses : write
13+ # Needed to create PR statuses/checks
14+ checks : write
15+ # To post comments on PRs
16+ issues : write
17+
518jobs :
619 build :
720 runs-on : ubuntu-latest
@@ -11,44 +24,35 @@ jobs:
1124 node-version : [10.x, 12.x]
1225
1326 steps :
14- - uses : actions/checkout@v1
15- - name : Use Node.js ${{ matrix.node-version }}
16- uses : actions/setup-node@v1
17- with :
18- node-version : ${{ matrix.node-version }}
19- - name : npm install, build, and lint
20- run : |
21- yarn
22- yarn build
23- yarn lint
27+ - uses : actions/checkout@v1
28+ - name : Use Node.js ${{ matrix.node-version }}
29+ uses : actions/setup-node@v1
30+ with :
31+ node-version : ${{ matrix.node-version }}
32+ - name : npm install, build, and lint
33+ run : |
34+ yarn
35+ yarn build
36+ yarn lint
2437 release :
2538 runs-on : ubuntu-latest
26-
39+ if : " !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci') "
2740 steps :
28- - uses : actions/checkout@v1
29- - name : Skip CI
30- uses : veggiemonk/skip-commit@master
31- env :
32- COMMIT_FILTER : skip ci
33- - name : Prepare repository
34- env :
35- GH_TOKEN : ${{ secrets.GH_TOKEN }}
36- run : |
37- git checkout "${GITHUB_REF:11}"
38- git remote rm origin
39- git remote add origin "https://$GH_TOKEN@github.com/hipstersmoothie/eslint-formatter-github.git"
40- git fetch origin
41- git branch --set-upstream-to origin/master
42- - name : Use Node.js 12.x
43- uses : actions/setup-node@v1
44- with :
45- node-version : 12.x
46- - name : Create Release
47- env :
48- GH_TOKEN : ${{ secrets.GH_TOKEN }}
49- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
50- run : |
51- git remote -v
52- yarn
53- yarn build
54- yarn release
41+ - uses : actions/checkout@v2
42+
43+ - name : Prepare repository
44+ run : git fetch --unshallow --tags
45+
46+ - name : Use Node.js 14.x
47+ uses : actions/setup-node@v1
48+ with :
49+ node-version : 14.x
50+
51+ - name : Create Release
52+ env :
53+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
54+ NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
55+ run : |
56+ yarn
57+ yarn build
58+ yarn release
0 commit comments