2021-07-19 14:31:24 +00:00
|
|
|
name: 🗒 Templates Stats
|
2021-07-19 13:58:18 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-09-10 12:17:08 +00:00
|
|
|
- uses: actions/checkout@master
|
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.17
|
2021-07-19 13:58:18 +00:00
|
|
|
|
|
|
|
- name: Installing Template Stats
|
|
|
|
run: |
|
2021-09-10 12:17:08 +00:00
|
|
|
go install github.com/projectdiscovery/templates-stats@main
|
2021-07-19 13:58:18 +00:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Markdown Stats
|
|
|
|
run: |
|
2021-07-26 17:57:15 +00:00
|
|
|
templates-stats -output TEMPLATES-STATS.md -path /home/runner/work/nuclei-templates/nuclei-templates/
|
2021-07-19 13:58:18 +00:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: JSON Stats
|
|
|
|
run: |
|
2021-07-26 17:57:15 +00:00
|
|
|
templates-stats -output TEMPLATES-STATS.json -json -path /home/runner/work/nuclei-templates/nuclei-templates/
|
2021-07-19 13:58:18 +00:00
|
|
|
shell: bash
|
|
|
|
|
2021-07-20 07:50:37 +00:00
|
|
|
- name: Top 10 Stats
|
|
|
|
run: |
|
2021-07-26 17:57:15 +00:00
|
|
|
templates-stats -output TOP-10.md -top 10 -path /home/runner/work/nuclei-templates/nuclei-templates/
|
2021-07-20 07:50:37 +00:00
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Get statistical changes
|
|
|
|
id: stats
|
|
|
|
run: echo "::set-output name=changes::$(git status -s | wc -l)"
|
|
|
|
|
2021-07-19 13:58:18 +00:00
|
|
|
- name: Commit files
|
2021-07-20 07:50:37 +00:00
|
|
|
if: steps.stats.outputs.changes > 0
|
2021-07-19 13:58:18 +00:00
|
|
|
run: |
|
2021-07-20 07:50:37 +00:00
|
|
|
git add TEMPLATES-STATS.*
|
|
|
|
git add TOP-10.md
|
2021-07-19 13:58:18 +00:00
|
|
|
git config --local user.email "action@github.com"
|
|
|
|
git config --local user.name "GitHub Action"
|
|
|
|
git commit -m "Auto Generated Templates Stats [$(date)] :robot:" -a
|
|
|
|
|
|
|
|
- name: Push changes
|
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
2021-07-19 14:31:24 +00:00
|
|
|
branch: ${{ github.ref }}
|