Skip to content

Commit add6719

Browse files
authored
Refactor GitHub CLI authentication
1 parent 15f8c51 commit add6719

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎.github/workflows/archive.yml‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Install dependencies
2424
run: |
2525
sudo apt-get update
26-
sudo apt-get install -y signify-openbsd gh
26+
sudo apt-get install -y rsync signify-openbsd gh
2727
2828
- name: Create Archive, Checksum, and Signature
2929
run: |
@@ -52,8 +52,8 @@ jobs:
5252
# Generate SHA256 checksum
5353
sha256sum "$ARCHIVE" | awk '{print $1}' > "$CHECKSUM"
5454
55-
# Create temporary signify key file
56-
printf "untrusted comment: GitHub Actions archive key\n%s\n" "$SIGNIFY_KEY" > "$TMP_DIR/archive.sec"
55+
# Write SIGNIFY_KEY secret to a temporary file
56+
printf "%s\n" "$SIGNIFY_KEY" > "$TMP_DIR/archive.sec"
5757
chmod 600 "$TMP_DIR/archive.sec"
5858
5959
# Sign the archive
@@ -66,10 +66,7 @@ jobs:
6666
run: |
6767
set -e
6868
69-
# Authenticate GitHub CLI
70-
echo "$GH_TOKEN" | gh auth login --with-token
71-
72-
# Setup git with GitHub CLI
69+
# Setup git to use GitHub CLI credentials (no gh auth login needed)
7370
gh auth setup-git
7471
git config user.name "github-actions[bot]"
7572
git config user.email "github-actions[bot]@users.noreply.github.com"
@@ -84,4 +81,3 @@ jobs:
8481
git push origin "$BRANCH"
8582
else
8683
echo "No changes to commit."
87-
fi

0 commit comments

Comments
 (0)