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

46 lines
1.4 KiB
YAML
Raw Normal View History

name: 🥳 New Template List
on:
push:
branches:
2023-01-05 10:56:27 +00:00
- main
2023-01-15 16:05:57 +00:00
paths:
- '**.yaml'
workflow_dispatch:
2024-01-15 10:09:24 +00:00
release:
types: [published]
jobs:
templates:
runs-on: ubuntu-latest
2022-03-23 15:25:35 +00:00
if: github.repository == 'projectdiscovery/nuclei-templates'
steps:
- uses: actions/checkout@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
2022-02-18 06:10:40 +00:00
persist-credentials: false
fetch-depth: 0
- name: Generate new template list
id: new-additions
run: |
2022-03-21 12:24:03 +00:00
git pull
git diff --name-only --diff-filter=A $(git tag | tail -n 1) @ . | grep .yaml | tee .new-additions
- name: Commit files
run: |
2024-01-08 10:08:42 +00:00
git config --local user.email "bot@projectdiscovery.io"
git config --local user.name "[PDBot]"
git add .new-additions -f
2022-02-22 12:45:07 +00:00
git commit --allow-empty -m "Auto Generated New Template Addition List [$(date)] :robot:" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
2022-03-21 12:24:03 +00:00
branch: ${{ github.ref }}
2024-01-10 15:09:29 +00:00
- name: Trigger Remote Workflow with curl
run: |
curl -i -s -k -X 'POST' -H 'Host: api.github.com' -H "Authorization: token ${{ secrets.GTOKEN }}" --data-binary $'{\"ref\":\"main\"}' 'https://api.github.com/repos/projectdiscovery/early-templates/actions/workflows/reposync.yml/dispatches'