Added template stats automation

patch-1
sandeep 2021-07-19 19:28:18 +05:30
parent bd48ea76cb
commit 4fd805743f
1 changed files with 57 additions and 0 deletions

57
.github/workflows/templates-stats.yml vendored Normal file
View File

@ -0,0 +1,57 @@
name: Templates Stats
on:
create:
tags:
- v*
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Setup golang
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Cache Go
id: cache-go
uses: actions/cache@v2
with:
path: /home/runner/go
key: ${{ runner.os }}-go
- name: Installing Template Stats
if: steps.cache-go.outputs.cache-hit != 'true'
env:
GO111MODULE: on
run: |
go get -v github.com/projectdiscovery/templates-stats
shell: bash
- name: Markdown Stats
run: |
templates-stats -output TEMPLATES-STATS.md -path .
shell: bash
- name: JSON Stats
run: |
templates-stats -output TEMPLATES-STATS.json -json -path .
shell: bash
- name: Commit files
run: |
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
if: steps.update-readme.outputs.changes > 0
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}