Skip to content

Commit

Permalink
feat: improve compare command and exclude checksums-s3 from calcs
Browse files Browse the repository at this point in the history
  • Loading branch information
f-hollow committed Jan 8, 2025
1 parent e967601 commit f061f29
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/prw-deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,15 @@ jobs:
SOURCE_DIR: './public-update'
DEST_DIR: "s3://${{ secrets.PREVIEW_AWS_BUCKET_NAME }}/pr${{ needs.determine-sync-status.outputs.pr-number }}"

- name: Calculate checksums for S3 bucket files and compare with CI checksums
- name: Calculate checksums for S3 bucket files
run: |
TEMP_DIR=$(mktemp -d)
aws s3 sync "s3://${{ secrets.PREVIEW_AWS_BUCKET_NAME }}/pr${{ needs.determine-sync-status.outputs.pr-number }}" "$TEMP_DIR" --follow-symlinks
cd "$TEMP_DIR"
find . -type f -exec sha256sum {} + | awk '{print $2, $1}' | sort > "$GITHUB_WORKSPACE/checksums-s3-verify.txt"
find . -type f ! -name "checksums-s3.txt" -exec sha256sum {} + | awk '{print $2, $1}' | sort > "$GITHUB_WORKSPACE/checksums-s3-verify.txt"
- name: Compare checksums of S3 bucket and CI files
run: |
cd "$GITHUB_WORKSPACE"
if diff checksums-ci.txt checksums-s3-verify.txt > diff-output.txt; then
echo "Checksums match. No differences found."
Expand Down

0 comments on commit f061f29

Please sign in to comment.