Skip to content

Commit

Permalink
dbg(git): Add settings reset #192
Browse files Browse the repository at this point in the history
  • Loading branch information
imAsparky committed Dec 13, 2024
1 parent 591ee14 commit 6f6f3bc
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/main_PR.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,21 +271,25 @@ jobs:
- name: Configure settings
run: |
# Create secure temporary directory
GNUPGHOME="$(mktemp -d)"
echo "${{ secrets.SGK }}" | gpg --batch --import
# Create secure temporary directory for GPG operations
export GNUPGHOME="$(mktemp -d)"
echo "GNUPGHOME=$GNUPGHOME" >> $GITHUB_ENV
echo "${{ secrets.SGK }}" | gpg --batch --import
# Get the key ID
SIGNING_KEY=$(gpg --list-secret-keys --keyid-format LONG | grep sec | awk '{print $2}' | cut -d'/' -f2)
echo "SIGNING_KEY=$SIGNING_KEY" >> $GITHUB_ENV
git config --local user.signingkey "$SIGNING_KEY"
git config --local commit.gpgsign true
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
echo "default-key $SIGNING_KEY" > "$GNUPGHOME/gpg.conf"
rm -rf "$GNUPGHOME"
chmod 700 "$GNUPGHOME"
find "$GNUPGHOME" -type f -exec chmod 600 {} \;
- name: Run Update Changelog Script
id: update_changelog
Expand Down Expand Up @@ -342,6 +346,13 @@ jobs:
run: |
echo "changelog_check_name=Update Changelog" >> $GITHUB_OUTPUT
- name: Remove Settings
if: always()
run: |
if [ -n "$GNUPGHOME" ] && [ -d "$GNUPGHOME" ]; then
rm -rf "$GNUPGHOME"
fi
- name: Update PR Status
if: steps.update_changelog.outputs.changes_made == 'true'
uses: actions/github-script@v7
Expand Down

0 comments on commit 6f6f3bc

Please sign in to comment.