📝 nuclei-update #2835
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 📝 nuclei-update | |
on: | |
schedule: | |
- cron: '1 */6 * * *' | |
push: | |
paths: | |
- 'plugins' | |
workflow_run: | |
workflows: [ "📝 fingerprint-update" ] | |
types: | |
- completed | |
workflow_dispatch: | |
env: | |
IS_GITHUB: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.repository == '0x727/FingerprintHub' | |
steps: | |
- name: Check out code | |
uses: actions/checkout@master | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Clone nuclei-templates | |
run: | | |
git clone --depth 100 --branch main https://github.com/projectdiscovery/nuclei-templates | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11.0" | |
- name: Update Nuclei | |
id: update-nuclei | |
run: | | |
python -m pip install --upgrade pip | |
pip install PyYAML | |
pip install GitPython | |
python .github/scripts/tags_to_plugins.py | |
find . -path "*.pyc" -delete | |
echo "::set-output name=changes::$(git status -s | wc -l)" | |
echo "::set-output name=changes_name::$(git status -s)" | |
- name: Commit files | |
if: steps.update-nuclei.outputs.changes > 0 | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Auto Update Nuclei [$(date)] :robot:" -a | |
- name: Push changes | |
if: steps.update-nuclei.outputs.changes > 0 | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
- name: Create Plugins Zip | |
run: | | |
zip -r plugins.zip plugins | |
- name: Upload plugins.zip to release | |
uses: svenstaro/upload-release-action@v1-release | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: plugins.zip | |
asset_name: plugins.zip | |
tag: default | |
overwrite: true |