diff --git a/.github/workflows/build-deploy-go.yml b/.github/workflows/build-deploy-go.yml index ee9b593..3ab6335 100644 --- a/.github/workflows/build-deploy-go.yml +++ b/.github/workflows/build-deploy-go.yml @@ -90,22 +90,21 @@ jobs: build: runs-on: ubuntu-latest steps: -# - name: Check GPG Private Key -# run: | -# if [ -z "${{ secrets.GPG_PRIVATE_KEY }}" ]; then -# echo "GPG_PRIVATE_KEY is null" -# else -# echo "GPG_PRIVATE_KEY is set" -# fi -# -# - name: Import GPG Key -# env: -# GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} -# GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} -# run: | -# echo "$GPG_PRIVATE_KEY" | gpg --import -# git config --global user.signingkey $GPG_KEY_ID -# git config --global commit.gpgsign true + - name: Import GPG Key + if: ${{ inputs.update_version }} + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} + run: | + echo "$GPG_PRIVATE_KEY" | gpg --import + git config --global user.signingkey $GPG_KEY_ID + git config --global commit.gpgsign true + # Configure Git with CI account details + git config --global user.name "ci-dominantstrategies" + git config --global user.email "ci@dominantstrategies.io" + + # Optionally, check that the GPG key is correctly configured for signing + gpg --list-keys "ci@dominantstrategies.io" - uses: actions/checkout@v3 with: @@ -228,13 +227,21 @@ jobs: ref: ${{ inputs.branch }} ssh-key: ${{ secrets.GH_PAT }} -# - name: Import GPG Key -# env: -# GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} -# GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} -# run: | -# echo "$GPG_PRIVATE_KEY" | gpg --import -# git config --global user.signingkey $GPG_KEY_ID + - name: Import GPG Key + if: ${{ inputs.update_version }} + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} + run: | + echo "$GPG_PRIVATE_KEY" | gpg --import + git config --global user.signingkey $GPG_KEY_ID + git config --global commit.gpgsign true + # Configure Git with CI account details + git config --global user.name "ci-dominantstrategies" + git config --global user.email "ci@dominantstrategies.io" + + # Optionally, check that the GPG key is correctly configured for signing + gpg --list-keys "ci@dominantstrategies.io" - name: Authenticate to Google Cloud if: ${{ !inputs.skip_deploy && inputs.gcp_project_id != '' && inputs.token_secret_name != '' }} diff --git a/.github/workflows/cut-release-common.yml b/.github/workflows/cut-release-common.yml index 6864737..86486d0 100644 --- a/.github/workflows/cut-release-common.yml +++ b/.github/workflows/cut-release-common.yml @@ -387,15 +387,22 @@ jobs: with: ssh-key: ${{ secrets.GH_PAT }} -# - name: Import GPG Key -# env: -# GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} -# GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} -# run: | -# echo "$GPG_PRIVATE_KEY" | gpg --import -# git config --global user.signingkey $GPG_KEY_ID -# git config --global commit.gpgsign true + - name: Import GPG Key + if: ${{ inputs.update_version }} + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} + run: | + echo "$GPG_PRIVATE_KEY" | gpg --import + git config --global user.signingkey $GPG_KEY_ID + git config --global commit.gpgsign true + # Configure Git with CI account details + git config --global user.name "ci-dominantstrategies" + git config --global user.email "ci@dominantstrategies.io" + # Optionally, check that the GPG key is correctly configured for signing + gpg --list-keys "ci@dominantstrategies.io" + - name: Set Repo Name run: | repo_name=$(basename ${{ github.repository }}) diff --git a/.github/workflows/deploy-prod-common.yml b/.github/workflows/deploy-prod-common.yml index 63d8ed4..0101d43 100644 --- a/.github/workflows/deploy-prod-common.yml +++ b/.github/workflows/deploy-prod-common.yml @@ -265,14 +265,21 @@ jobs: with: ssh-key: ${{ secrets.GH_PAT }} -# - name: Import GPG Key -# env: -# GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} -# GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} -# run: | -# echo "$GPG_PRIVATE_KEY" | gpg --import -# git config --global user.signingkey $GPG_KEY_ID -# git config --global commit.gpgsign true + - name: Import GPG Key + if: ${{ inputs.update_version }} + env: + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} + run: | + echo "$GPG_PRIVATE_KEY" | gpg --import + git config --global user.signingkey $GPG_KEY_ID + git config --global commit.gpgsign true + # Configure Git with CI account details + git config --global user.name "ci-dominantstrategies" + git config --global user.email "ci@dominantstrategies.io" + + # Optionally, check that the GPG key is correctly configured for signing + gpg --list-keys "ci@dominantstrategies.io" - name: Set Repo Name run: |