Merge pull request #2627 from projectdiscovery/cve-annotate-workflow

Added CVE Annotation workflow
patch-1
Sandeep Singh 2021-09-10 22:53:06 +05:30 committed by GitHub
commit 7b2e6a7559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 20 deletions

45
.github/workflows/cve-annotate.yml vendored Normal file
View File

@ -0,0 +1,45 @@
name: ✍🏻 CVE Annotate
on:
pull_request:
branches:
- master
workflow_dispatch:
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
persist-credentials: false
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Generate CVE Annotations
id: cve-annotate
run: |
if ! which cve-annotate > /dev/null; then
echo -e "Command cve-annotate not found! Installing\c"
go install github.com/projectdiscovery/nuclei/v2/cmd/cve-annotate@master
fi
cve-annotate -i ./cves/ -d .
echo "::set-output name=changes::$(git status -s | wc -l)"
- 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 cves
git commit -m "Auto Generated CVE annotations [$(date)] :robot:" -a
- name: Push changes
if: steps.cve-annotate.outputs.changes > 0
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -6,13 +6,10 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Repo - uses: actions/checkout@master
uses: actions/checkout@master - uses: actions/setup-go@v2
with:
- name: Setup golang go-version: 1.17
uses: actions/setup-go@v2
with:
go-version: 1.14
#- name: Cache Go #- name: Cache Go
# id: cache-go # id: cache-go
@ -26,7 +23,7 @@ jobs:
env: env:
GO111MODULE: on GO111MODULE: on
run: | run: |
go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei go install github.com/projectdiscovery/nuclei/v2/cmd/nuclei@master
shell: bash shell: bash
- name: Template Validation - name: Template Validation

View File

@ -11,21 +11,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.repository == 'projectdiscovery/nuclei-templates' && github.ref == 'refs/heads/master' if: github.repository == 'projectdiscovery/nuclei-templates' && github.ref == 'refs/heads/master'
steps: steps:
- name: Checkout Repo - uses: actions/checkout@master
uses: actions/checkout@master - uses: actions/setup-go@v2
with: with:
fetch-depth: 0 go-version: 1.17
- name: Setup golang
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Installing Template Stats - name: Installing Template Stats
env:
GO111MODULE: on
run: | run: |
go get -v github.com/projectdiscovery/templates-stats@main go install github.com/projectdiscovery/templates-stats@main
shell: bash shell: bash
- name: Markdown Stats - name: Markdown Stats