mirror of https://github.com/daffainfo/nuclei.git
workflows improvements (#2963)
parent
2874a9dff7
commit
5c8e715fc6
|
@ -2,6 +2,8 @@ name: 🔨 Build Test
|
|||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.go'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
@ -11,6 +13,7 @@ jobs:
|
|||
matrix:
|
||||
go-version: [1.18.x, 1.19.x]
|
||||
os: [ubuntu-latest, windows-latest, macOS-12]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Set up Go
|
||||
|
@ -21,8 +24,10 @@ jobs:
|
|||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download modules
|
||||
run: go clean -modcache; go mod download
|
||||
- name: Go Mod hygine
|
||||
run: |
|
||||
go clean -modcache
|
||||
go mod tidy
|
||||
working-directory: v2/
|
||||
|
||||
- name: Build
|
||||
|
|
|
@ -17,7 +17,7 @@ jobs:
|
|||
- name: Get Github tag
|
||||
id: meta
|
||||
run: |
|
||||
echo "::set-output name=tag::$(curl --silent "https://api.github.com/repos/projectdiscovery/nuclei/releases/latest" | jq -r .tag_name)"
|
||||
curl --silent "https://api.github.com/repos/projectdiscovery/nuclei/releases/latest" | jq -r .tag_name | xargs -I {} echo TAG={} >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
@ -37,4 +37,4 @@ jobs:
|
|||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: projectdiscovery/nuclei:latest,projectdiscovery/nuclei:${{ steps.meta.outputs.tag }}
|
||||
tags: projectdiscovery/nuclei:latest,projectdiscovery/nuclei:${{ steps.meta.outputs.TAG }}
|
|
@ -2,6 +2,8 @@ name: 🧪 Functional Test
|
|||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.go'
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@ name: ⏰ Publish Docs
|
|||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.go'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
@ -30,11 +32,11 @@ jobs:
|
|||
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
|
||||
echo "::set-output name=changes::$(git status -s | wc -l)"
|
||||
git status -s | wc -l | xargs -I {} echo CHANGES={} >> $GITHUB_OUTPUT
|
||||
working-directory: v2
|
||||
|
||||
- name: Commit files
|
||||
if: steps.generate-docs.outputs.changes > 0
|
||||
if: steps.generate-docs.outputs.CHANGES > 0
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
|
@ -42,7 +44,7 @@ jobs:
|
|||
git commit -m "Auto Generate Syntax Docs + JSONSchema [$(date)] :robot:" -a
|
||||
|
||||
- name: Push changes
|
||||
if: steps.generate-docs.outputs.changes > 0
|
||||
if: steps.generate-docs.outputs.CHANGES > 0
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
@ -2,7 +2,8 @@ name: 👮🏼♂️ Sonarcloud
|
|||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- '**.go'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
|
@ -2,6 +2,8 @@ name: 🛠 Template Validate
|
|||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.go'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
|
Loading…
Reference in New Issue