Skip to content

Commit 19d2a07

Browse files
authored
Update archive workflow to exclude temporary directory
1 parent 4e53872 commit 19d2a07

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎.github/workflows/archive.yml‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,29 @@ jobs:
4646
# Remove old files if they exist
4747
rm -f "$ARCHIVE" "$CHECKSUM" "$SIGNATURE"
4848
49-
# Create tar.gz archive in PAX format without using a pipe
50-
tar --format=pax --exclude="$ARCHIVE" -czf "$ARCHIVE" .
49+
# Create tar.gz archive in PAX format, excluding temporary directory
50+
tar --format=pax --exclude="tmp_archive" -czf "$ARCHIVE" .
5151
5252
# Generate SHA256 checksum
5353
sha256sum "$ARCHIVE" | awk '{print $1}' > "$CHECKSUM"
5454
55-
# Write SIGNIFY_KEY secret to a temporary file
55+
# Write SIGNIFY_KEY secret to a temporary file (never added to repo)
5656
printf "%s\n" "$SIGNIFY_KEY" > "$TMP_DIR/archive.sec"
5757
chmod 600 "$TMP_DIR/archive.sec"
5858
5959
# Sign the archive
6060
signify-openbsd -S -s "$TMP_DIR/archive.sec" -m "$ARCHIVE"
6161
62-
# Copy archive files to the repo's archive directory
63-
rsync -av --exclude="archive.sec" --delete "$TMP_DIR/" "$ARCHIVE_DIR/"
62+
# Copy only the archive, checksum, and signature to the repo's archive directory
63+
cp "$ARCHIVE" "$ARCHIVE_DIR/"
64+
cp "$CHECKSUM" "$ARCHIVE_DIR/"
65+
cp "$SIGNATURE" "$ARCHIVE_DIR/"
6466
6567
- name: Commit and Push Changes via GitHub CLI
6668
run: |
6769
set -e
6870
69-
# Setup git to use GitHub CLI credentials (no gh auth login needed)
71+
# Setup git to use GitHub CLI credentials
7072
gh auth setup-git
7173
git config user.name "github-actions[bot]"
7274
git config user.email "github-actions[bot]@users.noreply.github.com"
@@ -81,4 +83,3 @@ jobs:
8183
git push origin "$BRANCH"
8284
else
8385
echo "No changes to commit."
84-
fi

0 commit comments

Comments
 (0)