-
Notifications
You must be signed in to change notification settings - Fork 2.6k
40 lines (36 loc) · 1.06 KB
/
new-templates.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: 🥳 New Template List
on:
push:
branches:
- main
paths:
- '**.yaml'
workflow_dispatch:
release:
types: [published]
env:
NEW_ADDITION_FILE: '.new-additions'
jobs:
new-addition:
runs-on: ubuntu-latest
if: github.repository == 'projectdiscovery/nuclei-templates'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate new addition list
run: |
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
git diff --name-only --diff-filter=A $LATEST_TAG @ . | grep -v "^\.github/" | grep "\.yaml$" | tee $NEW_ADDITION_FILE
- uses: projectdiscovery/actions/setup/git@v1
- uses: projectdiscovery/actions/commit@v1
with:
files: '${{ env.NEW_ADDITION_FILE }}'
message: 'chore: generate new addition list 🤖'
- run: |
git pull origin $GITHUB_REF --rebase
git push origin $GITHUB_REF
sync:
needs: new-addition
uses: ./.github/workflows/templates-sync.yml
secrets: inherit