nuclei-templates/.github/workflows/cve-annotate.yml

46 lines
1.2 KiB
YAML
Raw Normal View History

name: ✍🏻 CVE Annotate
2021-09-10 12:11:35 +00:00
on:
2021-09-11 08:23:26 +00:00
push:
2021-09-10 12:11:35 +00:00
branches:
2023-01-05 10:56:27 +00:00
- main
2023-01-15 16:05:57 +00:00
paths:
2023-05-11 13:15:39 +00:00
- '**/cves/**.yaml'
2021-09-10 12:11:35 +00:00
workflow_dispatch:
jobs:
2023-06-03 16:36:47 +00:00
annotate:
2021-09-10 12:11:35 +00:00
runs-on: ubuntu-latest
steps:
2023-01-15 16:05:57 +00:00
- uses: actions/checkout@v3
with:
fetch-depth: 0
2021-09-10 12:18:49 +00:00
- name: Set up Go
uses: actions/setup-go@v4
with:
2023-06-03 16:36:47 +00:00
go-version: 1.20.x
2021-09-10 12:11:35 +00:00
- name: cve-annotate install
run: go install -v github.com/projectdiscovery/nuclei/v2/cmd/cve-annotate@latest
- name: Generate CVE Annotations
id: cve-annotate
2021-09-10 12:11:35 +00:00
run: |
2023-06-03 18:51:46 +00:00
cve-annotate -i .
git status -s | wc -l | xargs -I {} echo CHANGES={} >> $GITHUB_OUTPUT
2021-09-10 12:11:35 +00:00
- name: Commit files
if: steps.cve-annotate.outputs.CHANGES > 0
2021-09-10 12:11:35 +00:00
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
2023-05-11 13:15:39 +00:00
git add .
2023-06-03 18:41:10 +00:00
git commit -am "Auto Generated CVE annotations [$(date)] :robot:"
2021-09-10 12:11:35 +00:00
- name: Push changes
if: steps.cve-annotate.outputs.CHANGES > 0
2021-09-10 12:11:35 +00:00
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}