From 1dbc22f5542806b3a225a7cf84692deb0ccd410f Mon Sep 17 00:00:00 2001 From: Parth Malhotra <28601533+parthmalhotra@users.noreply.github.com> Date: Mon, 13 Mar 2023 18:55:03 +0530 Subject: [PATCH 1/2] Generate Checksum file for cves.json --- .github/workflows/cve2json.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cve2json.yml b/.github/workflows/cve2json.yml index d389ef699f..fa90ac2275 100644 --- a/.github/workflows/cve2json.yml +++ b/.github/workflows/cve2json.yml @@ -6,33 +6,36 @@ on: - main paths: - 'cves/**' + workflow_dispatch: # allows manual triggering of the workflow jobs: cve2json: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v2 with: go-version: 1.19 check-latest: true - - name: run yaml2json.go to generate cves.json + - name: Run yaml2json.go to generate cves.json run: | go env -w GO111MODULE=off go get gopkg.in/yaml.v3 go run .github/scripts/yaml2json.go $GITHUB_WORKSPACE/cves/ cves.json + md5sum cves.json | cut -d' ' -f1 > cves.json-checksum.txt + sed -i 's/ //g' cves.json-checksum.txt - name: Commit files run: | git pull - git add cves.json + git add cves.json cves.json-checksum.txt git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git commit -m "Auto Generated cves.json [$(date)] :robot:" -a - name: Push changes - uses: ad-m/github-push-action@master + uses: ad-m/github-push-action@v0.5.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} From 39d14a923044425aba5f29b686b4f1b4ac116ba2 Mon Sep 17 00:00:00 2001 From: Parth Malhotra <28601533+parthmalhotra@users.noreply.github.com> Date: Mon, 13 Mar 2023 19:04:43 +0530 Subject: [PATCH 2/2] Update cve2json.yml --- .github/workflows/cve2json.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cve2json.yml b/.github/workflows/cve2json.yml index fa90ac2275..405385aa8f 100644 --- a/.github/workflows/cve2json.yml +++ b/.github/workflows/cve2json.yml @@ -12,9 +12,9 @@ jobs: cve2json: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@master - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: 1.19 check-latest: true @@ -25,7 +25,6 @@ jobs: go get gopkg.in/yaml.v3 go run .github/scripts/yaml2json.go $GITHUB_WORKSPACE/cves/ cves.json md5sum cves.json | cut -d' ' -f1 > cves.json-checksum.txt - sed -i 's/ //g' cves.json-checksum.txt - name: Commit files run: | @@ -36,6 +35,6 @@ jobs: git commit -m "Auto Generated cves.json [$(date)] :robot:" -a - name: Push changes - uses: ad-m/github-push-action@v0.5.0 + uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }}