|
1 | 1 | name: Update dependencies |
2 | 2 |
|
3 | 3 | on: |
4 | | - schedule: |
5 | | - - cron: "00 23 * * 6" |
6 | | - workflow_dispatch: |
| 4 | + schedule: |
| 5 | + - cron: "00 23 * * 6" |
| 6 | + workflow_dispatch: |
7 | 7 |
|
8 | 8 | jobs: |
9 | | - build: |
10 | | - runs-on: ubuntu-latest |
| 9 | + build: |
| 10 | + runs-on: ubuntu-latest |
11 | 11 |
|
12 | | - steps: |
13 | | - - uses: actions/checkout@v2 |
14 | | - - name: Using Node 14 |
15 | | - uses: actions/setup-node@v1 |
16 | | - with: |
17 | | - node-version: 14 |
18 | | - - name: Update npm version to latest |
19 | | - run: npm install -g npm@latest # stop showing warnings about the lockfile |
20 | | - - name: Install dependencies |
21 | | - run: | |
22 | | - npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN |
23 | | - npm install |
24 | | - env: |
25 | | - NODE_AUTH_TOKEN: ${{github.token}} |
26 | | - - name: Update to the latest minor/patch version |
27 | | - run: npx npm-check-updates -u --target minor |
28 | | - - name: Install updated dependencies & update lockfile |
29 | | - run: npm install && npm update |
30 | | - - name: Make sure everything's ok |
31 | | - run: npm test |
32 | | - - name: Push changes to GitHub |
33 | | - run: | |
34 | | - git config --global user.name "github-actions" |
35 | | - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" |
36 | | - git diff --quiet && git diff --staged --quiet || git commit -am "$(date +%F) Automated dependencies update" |
37 | | - git push |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v2 |
| 14 | + - name: Using Node 14 |
| 15 | + uses: actions/setup-node@v1 |
| 16 | + with: |
| 17 | + node-version: 14 |
| 18 | + - name: Update npm version to latest |
| 19 | + run: npm install -g npm@latest # stop showing warnings about the lockfile |
| 20 | + - name: Install dependencies |
| 21 | + run: | |
| 22 | + npm config set //npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN |
| 23 | + npm ci |
| 24 | + env: |
| 25 | + NODE_AUTH_TOKEN: ${{github.token}} |
| 26 | + - name: Update to the latest minor/patch version |
| 27 | + # >3.4.2 of dtslint aren't friends with NPM advisories |
| 28 | + run: npx npm-check-updates -u --target minor --reject dtslint -e 2 |
| 29 | + - name: Install updated dependencies & update lockfile |
| 30 | + if: success() |
| 31 | + run: | |
| 32 | + npm install |
| 33 | + npm update |
| 34 | + - name: Make sure everything's ok |
| 35 | + run: npm test |
| 36 | + - name: Push changes to GitHub |
| 37 | + run: | |
| 38 | + git config --global user.name "github-actions" |
| 39 | + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 40 | + git diff --quiet && git diff --staged --quiet || git commit -am "$(date +%F) Automated dependencies update" |
| 41 | + git push |
0 commit comments