-
Notifications
You must be signed in to change notification settings - Fork 210
55 lines (54 loc) · 1.95 KB
/
update.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
55
# Github Action for updates to this repository
name: CVE Update
on:
# run every 5~10 minutes (min Github scheduling allowed)
# note this may not complete when the hourly "CVE Release" workflow starts,
# so that the updates in this task may not be reflected
# in the CVE Release artifacts running in a separate workflow
# note also that if this job runs longer than 5 minutes,
# the next job will run 5 minutes after this completes
schedule:
- cron: '*/5 * * * *'
# Enables manual runs of this workflow from the Actions tab
workflow_dispatch:
inputs:
# logLevel:
# description: 'Log level'
# required: false
# default: 'debug'
params:
description: 'command line arguments to update'
required: false
default: ''
jobs:
update-cves:
environment: deployment
runs-on: ubuntu-latest
env:
CVE_SERVICES_URL: https://cveawg.mitre.org
CVES_BASE_DIRECTORY: cves
CVES_RECENT_ACTIVITIES_FILENAME: recent_activities.json
CVES_DEFAULT_UPDATE_LOOKBACK_IN_MINS: 180
CVE_API_ORG: ${{secrets.CVE_API_ORG}}
CVE_API_USER: ${{secrets.CVE_API_USER}}
CVE_API_KEY: ${{secrets.CVE_API_KEY}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Update CVEs
run: |
export TEMP_TIMESTAMP=$(date '+%Y-%m-%d_%H%M_UTC')
echo "out=$TEMP_TIMESTAMP" >> $GITHUB_OUTPUT
git pull
git config --global user.email "github_action@example.com"
git config --global user.name "cvelistV5 Github Action"
git remote set-url origin https://${GITHUB_TOKEN}@github.com/${{github.repository}}.git
node ./.github/workflows/dist/index.js update ${{ github.event.inputs.params }}
git push
# - name: output
# uses: actions/github-script@v6
# with:
# script: |
# core.notice("this is a notice")