-
-
Notifications
You must be signed in to change notification settings - Fork 43
163 lines (157 loc) · 6.8 KB
/
Copy pathnode-dependency-watchdog.yml
File metadata and controls
163 lines (157 loc) · 6.8 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Node.js Dependency Watchdog
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
path-filter:
permissions:
pull-requests: read # dorny/paths-filter
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.filter.outputs.changes }}
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- id: filter
uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
with:
# TODO(cemmer): this is broken, have to use the 'push' event
base: ${{ github.ref }}
filters: |
changes:
- 'package*.json'
node-install-hold:
needs:
- path-filter
if: ${{ needs.path-filter.outputs.changes == 'true' }}
permissions:
contents: read # actions/checkout
pull-requests: write # thollander/actions-comment-pull-request
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: volta-cli/action@615a78f6c83e116339c53b94f3f82b4d6c0b7d18 # v5.0.0
- id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> "${GITHUB_OUTPUT}"
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-
- run: npm ci
- id: dependency-hold
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
{
echo "JSON<<$EOF"
npm run --silent deps:hold
echo "$EOF"
} >> "${GITHUB_OUTPUT}"
- uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
with:
message: |
## :hand: Dependency holds
A `package*.json` file changed in this pull request. As a notice, these dependencies are potentially being held back by the project's minimum supported Node.js version:
```json
${{ steps.dependency-hold.outputs.JSON }}
```
_Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._
mode: ${{ steps.dependency-hold.outputs.JSON && 'upsert' || 'delete' }}
create-if-not-exists: ${{ steps.dependency-hold.outputs.JSON && 'true' || 'false' }}
comment-tag: package-hold
node-deprecated-dependencies:
needs:
- path-filter
if: ${{ needs.path-filter.outputs.changes == 'true' }}
permissions:
contents: read # actions/checkout
pull-requests: write # thollander/actions-comment-pull-request
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: volta-cli/action@615a78f6c83e116339c53b94f3f82b4d6c0b7d18 # v5.0.0
- id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> "${GITHUB_OUTPUT}"
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-
- run: npm ci
- id: dependency-deprecated
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
{
echo "JSON<<$EOF"
npm run --silent deps:deprecated
echo "$EOF"
} >> "${GITHUB_OUTPUT}"
- uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
with:
message: |
## :skull: Deprecated dependencies
A `package*.json` file changed in this pull request. As a notice, these dependencies are deprecated or have not released a new version in over two years:
```json
${{ steps.dependency-deprecated.outputs.JSON }}
```
_Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._
mode: ${{ steps.dependency-deprecated.outputs.JSON && 'upsert' || 'delete' }}
create-if-not-exists: ${{ steps.dependency-deprecated.outputs.JSON && 'true' || 'false' }}
comment-tag: package-deprecated
node-vulnerabilities:
needs:
- path-filter
if: ${{ needs.path-filter.outputs.changes == 'true' }}
permissions:
contents: read # actions/checkout
pull-requests: write # thollander/actions-comment-pull-request
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: volta-cli/action@615a78f6c83e116339c53b94f3f82b4d6c0b7d18 # v5.0.0
- id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> "${GITHUB_OUTPUT}"
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
${{ runner.os }}-
- run: npm ci
- id: dependency-vulnerabilities
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
{
echo "JSON<<$EOF"
npm run --silent deps:vulnerabilities
echo "$EOF"
} >> "${GITHUB_OUTPUT}"
- uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
with:
message: |
## :warning: Vulnerable dependencies
A `package*.json` file changed in this pull request. As a notice, these dependencies have known security vulnerabilities:
```json
${{ steps.dependency-vulnerabilities.outputs.JSON }}
```
_Comment generated by the [${{ github.workflow }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}) workflow._
mode: ${{ steps.dependency-vulnerabilities.outputs.JSON && 'upsert' || 'delete' }}
create-if-not-exists: ${{ steps.dependency-vulnerabilities.outputs.JSON && 'true' || 'false' }}
comment-tag: package-vulnerabilities