test-optimize-cve-update #1206
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Github Action for updates to this repository | |
name: test-optimize-cve-update | |
on: | |
workflow_dispatch: | |
inputs: | |
params: | |
description: 'command line arguments to update' | |
required: false | |
default: '' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
update-cves: | |
permissions: | |
contents: write | |
environment: deployment | |
runs-on: ubuntu-latest | |
env: | |
CVE_SERVICES_URL: https://cveawg-adp-test.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: 1 | |
- name: Update CVEs | |
run: | | |
export TEMP_TIMESTAMP=$(date '+%Y-%m-%d_%H%M_UTC') | |
echo "out=$TEMP_TIMESTAMP" >> $GITHUB_OUTPUT | |
git config --global user.email "[email protected]" | |
git config --global user.name "cvelistV5 Github Action - optimized" | |
git remote set-url origin https://${GITHUB_TOKEN}@github.com/${{github.repository}}.git | |
export START_TS=$(jq -c -r .fetchTime < $CVES_BASE_DIRECTORY/delta.json) | |
export PREV_TS=$(jq -c -r .[2].fetchTime < $CVES_BASE_DIRECTORY/deltaLog.json) | |
node ./.github/workflows/dist/index.js update ${{ github.event.inputs.params }} --start=$PREV_TS | |
git push |