2023-10-19 13:09:58 +00:00
|
|
|
name: ☑️ Template Sign
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- '**.yaml'
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2024-03-02 09:35:40 +00:00
|
|
|
if: github.repository == 'projectdiscovery/nuclei-templates'
|
2023-10-19 13:09:58 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Set up Go
|
2023-12-11 05:07:46 +00:00
|
|
|
uses: actions/setup-go@v5
|
2023-10-19 13:09:58 +00:00
|
|
|
with:
|
|
|
|
go-version: 1.21.x
|
|
|
|
|
|
|
|
- name: nuclei install
|
2024-04-23 10:03:34 +00:00
|
|
|
run: go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
|
2023-10-19 13:09:58 +00:00
|
|
|
|
|
|
|
- name: Template Sign
|
|
|
|
id: sign
|
|
|
|
run: |
|
|
|
|
nuclei -lfa -duc -sign -t /home/runner/work/nuclei-templates/nuclei-templates
|
|
|
|
nuclei -lfa -duc -t /home/runner/work/nuclei-templates/nuclei-templates
|
|
|
|
git status -s | wc -l | xargs -I {} echo CHANGES={} >> $GITHUB_OUTPUT
|
|
|
|
env:
|
|
|
|
NUCLEI_USER_CERTIFICATE: ${{ secrets.NUCLEI_USER_CERTIFICATE }}
|
|
|
|
NUCLEI_USER_PRIVATE_KEY: ${{ secrets.NUCLEI_USER_PRIVATE_KEY }}
|
|
|
|
|
|
|
|
- name: Commit files
|
|
|
|
if: steps.sign.outputs.CHANGES > 0
|
|
|
|
run: |
|
|
|
|
git config --local user.email "action@github.com"
|
|
|
|
git config --local user.name "GitHub Action"
|
|
|
|
git add cves.json cves.json-checksum.txt
|
|
|
|
git commit -m "Auto Template Signing [$(date)] :robot:" -a
|
|
|
|
|
|
|
|
- name: Push changes
|
|
|
|
if: steps.sign.outputs.CHANGES > 0
|
|
|
|
run: |
|
|
|
|
git pull --rebase
|
|
|
|
git push origin ${{ github.ref }}
|
|
|
|
env:
|
2023-10-19 13:32:51 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|