generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (51 loc) · 1.67 KB
/
npm-check-updates.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
45
46
47
48
49
50
51
52
53
54
name: npm-check-updates
on:
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: Versions
run: |
node --version
npm --version
- run: npm install -g npm-check-updates
- run: ncu -u
- run: npm install
- run: npm audit fix
- run: npm run format
- run: npm run build
- run: npm run lint
- run: npm run package
- run: npm test
env:
CONSUMER_API_KEY: ${{ secrets.CONSUMER_API_KEY }}
CONSUMER_API_SECRET_KEY: ${{ secrets.CONSUMER_API_SECRET_KEY }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
ACCESS_TOKEN_SECRET: ${{ secrets.ACCESS_TOKEN_SECRET }}
- name: Diff
id: diff
run: |
git add -N .
git diff --name-only --exit-code
continue-on-error: true
- uses: snow-actions/git-config-user@v1.0.0
- name: Commit & Push
run: |
set -x
git switch -C dependencies/npm-check-updates
git add .
git commit -m 'npm-check-updates'
git push --force --set-upstream origin dependencies/npm-check-updates
if: steps.diff.outcome == 'failure'
- name: Create PR
run: |
set -x
if [ $(gh pr list --base ${GITHUB_REF} --head dependencies/npm-check-updates | wc -l) -eq 0 ]; then
gh pr create --base ${GITHUB_REF} --head dependencies/npm-check-updates --title 'npm-check-updates' --body '' --label dependencies --reviewer SnowCait
fi
env:
GH_TOKEN: ${{ github.token }}
if: steps.diff.outcome == 'failure'