Browse Source

chore: enhance GitHub Actions workflows with GPG key input for signing releases

- Added an optional input for GPG private key in release.yml to support signing releases.
- Updated the conditional check for GPG key import to utilize the new input, improving flexibility and maintainability.
- Ensured that the auto-tag workflow inherits secrets for better security practices.
pull/122/head
煎饼果子卷鲨鱼辣椒 5 months ago
parent
commit
01a932f3e5
  1. 2
      .github/workflows/auto-tag.yml
  2. 4
      .github/workflows/release.yml

2
.github/workflows/auto-tag.yml

@ -51,4 +51,6 @@ jobs:
needs: auto-tag needs: auto-tag
if: success() if: success()
uses: ./.github/workflows/release.yml uses: ./.github/workflows/release.yml
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
secrets: inherit secrets: inherit

4
.github/workflows/release.yml

@ -40,9 +40,9 @@ jobs:
- name: Import GPG key - name: Import GPG key
id: import_gpg id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6 uses: crazy-max/ghaction-import-gpg@v6
if: "${{ secrets.GPG_PRIVATE_KEY != '' }}"
if: inputs.gpg_private_key != ''
with: with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_private_key: ${{ inputs.gpg_private_key }}
passphrase: ${{ secrets.PASSPHRASE }} passphrase: ${{ secrets.PASSPHRASE }}
- name: Run GoReleaser - name: Run GoReleaser

Loading…
Cancel
Save