2021-07-19 14:31:24 +00:00
|
|
|
name: 🗒 Templates Stats
|
2021-07-19 13:58:18 +00:00
|
|
|
|
|
|
|
on:
|
2021-12-31 14:08:49 +00:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '*'
|
2021-07-19 13:58:18 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-01-05 11:28:11 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-09-10 12:17:08 +00:00
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
with:
|
2022-11-21 11:30:34 +00:00
|
|
|
go-version: 1.18
|
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
|
2022-11-21 11:30:34 +00:00
|
|
|
run: git status -s | wc -l | xargs -I {} echo CHANGES={} >> $GITHUB_OUTPUT
|
2021-07-20 07:50:37 +00:00
|
|
|
|
2021-07-19 13:58:18 +00:00
|
|
|
- name: Commit files
|
2022-11-21 11:30:34 +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:
|
2023-01-05 11:47:22 +00:00
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|