@@ -2,9 +2,6 @@ name: Check main for vulns daily
2
2
3
3
on :
4
4
workflow_dispatch :
5
- inputs :
6
- nodejsStream :
7
- default : ' main'
8
5
schedule :
9
6
- cron : 0 0 * * *
10
7
@@ -13,45 +10,7 @@ permissions:
13
10
14
11
jobs :
15
12
check-vulns :
16
- runs-on : ubuntu-latest
17
- steps :
18
- - name : Setup Python 3.9
19
- uses : actions/setup-python@v3
20
- with :
21
- python-version : ' 3.9'
22
- - name : Checkout node.js repo
23
- uses : actions/checkout@v3
24
- with :
25
- repository : nodejs/node
26
- path : node
27
- ref : ${{ github.event.inputs.nodejsStream || 'main' }}
28
- - name : Installing pre-reqs
29
- run : |
30
- cd ${{ github.workspace }}/node/tools/dep_checker
31
- pip install -r requirements.txt
32
- - name : Run the check
33
- run : |
34
- cd ${{ github.workspace }}/node/tools/dep_checker
35
- (
36
- set -o pipefail
37
- python main.py --gh-token ${{ secrets.VULN_CHECK_TOKEN }} 2>&1 | tee result.log
38
- )
39
- - name : collect error
40
- id : collect_error
41
- if : ${{ failure() }}
42
- run : |
43
- cd ${{ github.workspace }}/node/tools/dep_checker
44
- result=`cat result.log`
45
- curdate=`date`
46
- echo "::set-output name=date::$curdate"
47
- echo "::set-output name=result::$result"
48
- - name : check for failure
49
- if : ${{ failure() }}
50
- run : |
51
- curl --request POST \
52
- --url https://api.github.com/repos/${{ github.repository }}/issues \
53
- --header 'Authorization: token ${{ secrets.VULN_CHECK_TOKEN }}' \
54
- --header 'Accept: application/vnd.github+json' \
55
- --data '{
56
- "title": "Vulnerability check reported failure - ${{ steps.collect_error.outputs.date }}",
57
- "body": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} \\\n${{ steps.collect_error.outputs.result }}"}'
13
+ uses : ./.github/workflows/check-vulns.yml
14
+ with :
15
+ nodejsStream : main
16
+ secrets : inherit
0 commit comments