nuclei-templates/.github/workflows/cve2json.yml

41 lines
1.1 KiB
YAML
Raw Normal View History

name: Generate JSON Metadata of CVE Templates
on:
push:
branches:
- main
paths:
2023-06-19 08:26:08 +00:00
- '**/http/cves/'
2023-03-13 13:25:03 +00:00
workflow_dispatch: # allows manual triggering of the workflow
jobs:
cve2json:
runs-on: ubuntu-latest
steps:
2023-03-13 13:34:43 +00:00
- uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
check-latest: true
2023-01-18 03:32:45 +00:00
2023-03-13 13:25:03 +00:00
- name: Run yaml2json.go to generate cves.json
run: |
2023-01-18 03:37:27 +00:00
go env -w GO111MODULE=off
2023-01-18 03:39:39 +00:00
go get gopkg.in/yaml.v3
2023-05-04 07:15:51 +00:00
go run .github/scripts/yaml2json.go $GITHUB_WORKSPACE/http/cves/ cves.json
2023-03-13 13:25:03 +00:00
md5sum cves.json | cut -d' ' -f1 > cves.json-checksum.txt
- name: Commit files
run: |
git pull
2023-03-13 13:25:03 +00:00
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
2023-03-13 13:34:43 +00:00
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}