From 1f8ffd2f69a401afcd4109d8793533dca1cfe88b Mon Sep 17 00:00:00 2001 From: arashagp Date: Thu, 2 Jan 2025 11:18:57 +0330 Subject: [PATCH] refactor: add GPG private key to release workflow for enhanced security --- .github/workflows/release.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a8e5e64..341a52e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,10 +17,16 @@ on: BOT_TOKEN: required: true description: "Nexim Bot token" + GPG_PRIVATE_KEY: + required: true + description: "GPG private key" permissions: contents: write +env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + jobs: main: name: Build & Lint & Test & Release @@ -35,10 +41,10 @@ jobs: - name: 🙂‍↔️ Import GPG key run: | - echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import + echo "${{ env.GPG_PRIVATE_KEY }}" | gpg --batch --import echo -e "5\ny\n" | gpg --batch --yes --command-fd 0 --edit-key ${{ secrets.GPG_KEY_ID }} trust quit env: - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY}} - name: 🫡 Setup Git run: |