merge workflow and only resign windows templates

This commit is contained in:
Tarun Koyalwar
2024-12-01 19:24:28 +05:30
parent 972a39f103
commit d0845c00af
2 changed files with 48 additions and 52 deletions

View File

@@ -9,8 +9,8 @@ on:
workflow_dispatch:
jobs:
build:
name: Sign All Templates
linux-sign:
name: Sign All Templates (Linux)
runs-on: ubuntu-latest
if: github.repository == 'projectdiscovery/nuclei-templates'
steps:
@@ -28,4 +28,49 @@ jobs:
- name: Push changes
run: |
git pull origin $GITHUB_REF --rebase
git push origin $GITHUB_REF
git push origin $GITHUB_REF
windows-sign:
name: Sign Windows Templates
needs: linux-sign
runs-on: windows-latest
if: github.repository == 'projectdiscovery/nuclei-templates'
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install Nuclei
run: |
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
nuclei -version
shell: bash
- name: Sign Windows Templates
run: nuclei -lfa -duc -sign -ud "${{ github.workspace }}" -t "code/windows/audit"
shell: bash
env:
NUCLEI_USER_CERTIFICATE: ${{ secrets.NUCLEI_USER_CERTIFICATE }}
NUCLEI_USER_PRIVATE_KEY: ${{ secrets.NUCLEI_USER_PRIVATE_KEY }}
- name: Configure Git
run: |
git config --global user.name "Ghost"
git config --global user.email "ghost@users.noreply.github.com"
shell: bash
- name: Commit Changes
run: |
git add code/windows/audit
git commit -m "chore: re-sign windows templates 🤖" || echo "No changes to commit"
shell: bash
- name: Push Changes
run: |
git remote update
git pull origin ${{ github.ref }} --rebase || exit 1
git push origin ${{ github.ref }} || (git remote update && git pull origin ${{ github.ref }} --rebase && git push origin ${{ github.ref }})
shell: bash

View File

@@ -1,49 +0,0 @@
name: Windows Template Resign
on:
workflow_dispatch:
jobs:
windows-resign:
name: Re-sign Templates on Windows
runs-on: windows-latest
if: github.repository == 'projectdiscovery/nuclei-templates'
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Install Nuclei
run: |
go install -v github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
nuclei -version
shell: bash
- name: Sign Templates
run: nuclei -lfa -duc -sign -ud "${{ github.workspace }}" -t "."
shell: bash
env:
NUCLEI_USER_CERTIFICATE: ${{ secrets.NUCLEI_USER_CERTIFICATE }}
NUCLEI_USER_PRIVATE_KEY: ${{ secrets.NUCLEI_USER_PRIVATE_KEY }}
- name: Configure Git
run: |
git config --global user.name "Ghost"
git config --global user.email "ghost@users.noreply.github.com"
shell: bash
- name: Commit Changes
run: |
git add .
git commit -m "chore: re-sign templates on windows 🤖" || echo "No changes to commit"
shell: bash
- name: Push Changes
run: |
git remote update
git pull origin ${{ github.ref }} --rebase || exit 1
git push origin ${{ github.ref }} || (git remote update && git pull origin ${{ github.ref }} --rebase && git push origin ${{ github.ref }})
shell: bash