Skip to content

Commit 00ed9e9

Browse files
authored
fix: Path to checksum file was relative and it caused issues when run from the action workflow (#6)
When running in a workflow, the generate_version_checksums.sh was being executed from the root of the workspace which caused the relative path to be incorrect. Changed the main script to accept the checksum file as a parameter and updated the workflow to pass the fully qualified path.
1 parent 26f7b08 commit 00ed9e9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/generate_version_checksums.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#!/bin/sh
22

3+
checksum_file=$1
4+
if [ "${checksum_file}" = "" ];
5+
then
6+
echo "Usage: $0 <path to checkums file>";
7+
exit 1;
8+
fi;
9+
310
mkdir -p temp
411
cd temp || exit
512

613
export GNUPGHOME=./.gnupg;
714

8-
checksum_file=../../terraform-checksums.json
9-
1015
# Generate a temporary key to use for verification
1116
gpg --batch --quick-generate-key --batch --passphrase "" [email protected];
1217

.github/workflows/update-checksums.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: 'actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8' # ratchet:actions/checkout@v3
3030
# Generate updates to the checksum file if there are new released versions of terraform
3131
- id: 'generate-updates'
32-
run: './.github/generate_version_checksums.sh;'
32+
run: './.github/generate_version_checksums.sh $GITHUB_WORKSPACE/terraform-checksums.json;'
3333
# Create a pull request for review
3434
- id: 'create-pull-request'
3535
if: ${{ env.CHANGES }}

0 commit comments

Comments
 (0)