diff --git a/.github/workflows/template-sign.yml b/.github/workflows/template-sign.yml index 2db597d0967..3fd7fd90796 100644 --- a/.github/workflows/template-sign.yml +++ b/.github/workflows/template-sign.yml @@ -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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/.github/workflows/windows-resign.yml b/.github/workflows/windows-resign.yml deleted file mode 100644 index bad12743dd3..00000000000 --- a/.github/workflows/windows-resign.yml +++ /dev/null @@ -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