mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-29 09:03:09 +00:00
59 lines
1.8 KiB
YAML
59 lines
1.8 KiB
YAML
name: Publish Docs
|
|
|
|
on:
|
|
#create:
|
|
# tags:
|
|
# - v*
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@master
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 0
|
|
ref: yamldoc # temporary
|
|
|
|
- name: Check out nuclei-docs
|
|
uses: actions/checkout@master
|
|
with:
|
|
repository: projectdiscovery/nuclei-docs
|
|
persist-credentials: false
|
|
fetch-depth: 0
|
|
token: ${{ secrets.PRIVATE_CLONE_TOKEN }}
|
|
|
|
- name: "Set up Go"
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.16
|
|
|
|
- name: Generate YAML Syntax Documentation
|
|
run: |
|
|
go run cmd/docgen/docgen.go ../nuclei-docs/docs.md
|
|
if ! which dstdocgen > /dev/null; then
|
|
echo -e "Command not found! Installing\c"
|
|
go get -v github.com/projectdiscovery/yamldoc-go/cmd/docgen/dstdocgen
|
|
fi
|
|
go generate pkg/templates/templates.go
|
|
go build -o "cmd/docgen/docgen" cmd/docgen/docgen.go
|
|
./cmd/docgen/docgen syntax-reference.md
|
|
echo "::set-output name=changes::$(git status -s | wc -l)"
|
|
working-directory: v2
|
|
|
|
- name: Commit files
|
|
if: steps.update-readme.outputs.changes > 0
|
|
run: |
|
|
git config --local user.email "action@github.com"
|
|
git config --local user.name "GitHub Action"
|
|
git add syntax-reference.md
|
|
git commit -m "Auto Generate Syntax Docs [$(date)] :robot:" -a
|
|
|
|
- name: Push changes
|
|
if: steps.update-readme.outputs.changes > 0
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: ${{ github.ref }} |