nuclei-templates/.github/workflows/templates-stats.yml

59 lines
1.6 KiB
YAML
Raw Normal View History

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
2024-03-02 09:35:40 +00:00
if: github.repository == 'projectdiscovery/nuclei-templates'
2021-07-19 13:58:18 +00:00
steps:
- uses: actions/checkout@v4
2023-01-05 11:28:11 +00:00
with:
fetch-depth: 0
2023-01-15 16:05:57 +00:00
- name: Set up Go
uses: actions/setup-go@v5
2023-01-15 16:05:57 +00:00
with:
go-version: 1.19
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: 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
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 }}