Skip to content

Commit

Permalink
Workflow support (#33)
Browse files Browse the repository at this point in the history
* add support for workflows

* use correct workflow argument in command

* readme update

Co-authored-by: sandeep <[email protected]>
  • Loading branch information
Sitebase and ehsandeep authored Apr 19, 2022
1 parent 8593cd0 commit 69fe4e1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ jobs:
<ins>As default, all the default [nuclei-templates](https://github.com/projectdiscovery/nuclei-templates) are used for scan.</ins>
**GitHub Action running Nuclei with custom workflows**
```yaml
- name: Nuclei - DAST Scan
uses: projectdiscovery/nuclei-action@main
with:
target: https://example.com
workflows: custom_workflow_path
```
**GitHub Action running Nuclei on multiple URLs**
```yaml
Expand Down Expand Up @@ -139,6 +149,7 @@ Available Inputs
| `target` | Target URL to run nuclei scan | true |
| `urls` | List of urls to run nuclei scan | false |
| `templates` | Custom templates directory/file to run nuclei scan | false |
| `workflows` | Custom workflows file/files to check across hosts | false |
| `output` | File to save output result (default - nuclei.log) | false |
| `json` | Write results in JSON format | false |
| `include-rr` | Include request/response in results | false |
Expand Down
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
description: "Templates input file/files to check across hosts"
required: false

workflows:
description: "Workflows input file/files to check across hosts"
required: false

output:
description: "File to save output result"
required: false
Expand Down Expand Up @@ -78,6 +82,7 @@ runs:
[ ! -z ${{ inputs.target }} ] && echo "nuclei-target=-target ${{ inputs.target}}" >> $GITHUB_ENV
[ ! -z ${{ inputs.urls }} ] && echo "nuclei-urls=-list ${{ inputs.urls}}" >> $GITHUB_ENV
[ ! -z ${{ inputs.templates }} ] && echo "nuclei-templates=-t ${{ inputs.templates }}" >> $GITHUB_ENV
[ ! -z ${{ inputs.workflows }} ] && echo "nuclei-workflows=-w ${{ inputs.workflows }}" >> $GITHUB_ENV
[ ! -z ${{ inputs.output }} ] && echo "nuclei-output=-o ${{ inputs.output}}" >> $GITHUB_ENV || echo "output=-o nuclei.log" >> $GITHUB_ENV
[ ! -z ${{ inputs.sarif-export }} ] && echo "nuclei-sarif-export=-se ${{ inputs.sarif-export}}" >> $GITHUB_ENV || echo "sarif-export=-se nuclei.sarif" >> $GITHUB_ENV
[ ! -z ${{ inputs.markdown-export }} ] && echo "nuclei-markdown-export=-me ${{ inputs.markdown-export}}" >> $GITHUB_ENV
Expand All @@ -96,15 +101,17 @@ runs:
&& echo -e " project-name: \"${GITHUB_REPOSITORY#*/}\"" >> ~/nuclei-github-config.yaml \
&& echo -e " issue-label: \"Nuclei\"" >> ~/nuclei-github-config.yaml \
&& echo "nuclei-githubconfig=-rc ~/nuclei-github-config.yaml" >> $GITHUB_ENV
nuclei -silent
shell: bash
- run: |
nuclei \
${{ env.nuclei-target }} \
${{ env.nuclei-urls }} \
${{ env.nuclei-templates }} \
${{ env.nuclei-workflows }} \
${{ env.nuclei-output }} \
${{ env.nuclei-sarif-export }} \
${{ env.nuclei-markdown-export }} \
Expand Down

0 comments on commit 69fe4e1

Please sign in to comment.