diff --git a/.github/workflows/cve-annotate.yml b/.github/workflows/cve-annotate.yml new file mode 100644 index 0000000000..754b772885 --- /dev/null +++ b/.github/workflows/cve-annotate.yml @@ -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 }} diff --git a/.github/workflows/template-validate.yml b/.github/workflows/template-validate.yml index d0d3ede28e..89bd02fd49 100644 --- a/.github/workflows/template-validate.yml +++ b/.github/workflows/template-validate.yml @@ -6,13 +6,10 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout Repo - uses: actions/checkout@master - - - name: Setup golang - uses: actions/setup-go@v2 - with: - go-version: 1.14 + - uses: actions/checkout@master + - uses: actions/setup-go@v2 + with: + go-version: 1.17 #- name: Cache Go # id: cache-go @@ -26,7 +23,7 @@ jobs: env: GO111MODULE: on run: | - go get -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei + go install github.com/projectdiscovery/nuclei/v2/cmd/nuclei@master shell: bash - name: Template Validation diff --git a/.github/workflows/templates-stats.yml b/.github/workflows/templates-stats.yml index 3fbb305a96..db02a5df05 100644 --- a/.github/workflows/templates-stats.yml +++ b/.github/workflows/templates-stats.yml @@ -11,21 +11,14 @@ jobs: runs-on: ubuntu-latest if: github.repository == 'projectdiscovery/nuclei-templates' && github.ref == 'refs/heads/master' steps: - - name: Checkout Repo - uses: actions/checkout@master - with: - fetch-depth: 0 - - - name: Setup golang - uses: actions/setup-go@v2 - with: - go-version: 1.14 + - uses: actions/checkout@master + - uses: actions/setup-go@v2 + with: + go-version: 1.17 - name: Installing Template Stats - env: - GO111MODULE: on run: | - go get -v github.com/projectdiscovery/templates-stats@main + go install github.com/projectdiscovery/templates-stats@main shell: bash - name: Markdown Stats