46 lines
1.2 KiB
YAML
46 lines
1.2 KiB
YAML
name: ✍🏻 CVE Annotate
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- '**/cves/**.yaml'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
annotate:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: 1.20.x
|
|
|
|
- name: cve-annotate install
|
|
run: go install -v github.com/projectdiscovery/nuclei/v2/cmd/cve-annotate@latest
|
|
|
|
- name: Generate CVE Annotations
|
|
id: cve-annotate
|
|
run: |
|
|
cve-annotate -i .
|
|
git status -s | wc -l | xargs -I {} echo CHANGES={} >> $GITHUB_OUTPUT
|
|
|
|
- name: Commit files
|
|
if: steps.cve-annotate.outputs.CHANGES > 0
|
|
run: |
|
|
git config --local user.email "action@github.com"
|
|
git config --local user.name "GitHub Action"
|
|
git add .
|
|
git commit -am "Auto Generated CVE annotations [$(date)] :robot:"
|
|
|
|
- name: Push changes
|
|
if: steps.cve-annotate.outputs.CHANGES > 0
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: ${{ github.ref }} |