mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 16:05:26 +00:00
48 lines
1.5 KiB
YAML
48 lines
1.5 KiB
YAML
name: ⏰ Publish Docs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
publish-docs:
|
|
if: "! endsWith(github.actor, '[bot]')"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: "Set up Go"
|
|
uses: projectdiscovery/actions/setup/go@v1
|
|
|
|
- name: "Set up Git"
|
|
uses: projectdiscovery/actions/setup/git@v1
|
|
|
|
- name: Generate YAML Syntax Documentation
|
|
id: generate-docs
|
|
run: |
|
|
if ! which dstdocgen > /dev/null; then
|
|
echo -e "Command dstdocgen not found! Installing\c"
|
|
go install github.com/projectdiscovery/yamldoc-go/cmd/docgen/dstdocgen@main
|
|
fi
|
|
go generate pkg/templates/templates.go
|
|
go build -o "cmd/docgen/docgen" cmd/docgen/docgen.go
|
|
./cmd/docgen/docgen SYNTAX-REFERENCE.md nuclei-jsonschema.json
|
|
git status -s | wc -l | xargs -I {} echo CHANGES={} >> $GITHUB_OUTPUT
|
|
|
|
- name: Commit files
|
|
if: steps.generate-docs.outputs.CHANGES > 0
|
|
run: |
|
|
git add SYNTAX-REFERENCE.md nuclei-jsonschema.json
|
|
git commit -m "Auto Generate Syntax Docs + JSONSchema [$(date)] :robot:" -a
|
|
|
|
- name: Push changes
|
|
if: steps.generate-docs.outputs.CHANGES > 0
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: ${{ github.ref }} |