Skip to content

Commit 378a913

Browse files
Copilotandrewb1269
andauthored
chore: improve gomplate download failure diagnostics
Agent-Logs-Url: https://github.com/PandasWhoCode/initialize-github-job/sessions/e31e712d-aee7-47d1-b74d-57c36f48b802 Co-authored-by: andrewb1269 <184121471+andrewb1269@users.noreply.github.com>
1 parent a255c20 commit 378a913

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ Common steps for initializing a job for GitHub actions. This composite action co
113113

114114
| Input | Description | Required | Default |
115115
|----------------|--------------------------|----------|---------|
116-
| setup-gomplate | Whether to setup gomplate | No | - |
116+
| setup-gomplate | Whether to setup gomplate | No | false |
117+
118+
> [!NOTE]
119+
> `setup-gomplate` currently installs the Linux AMD64 gomplate release artifact.
117120

118121
### Outputs
119122

action.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,19 @@ runs:
411411
if: ${{ inputs.setup-gomplate == 'true' }}
412412
shell: bash
413413
run: |
414-
curl -sSfL "https://github.com/hairyhenderson/gomplate/releases/download/v5.0.0/gomplate_linux-amd64" \
415-
-o /tmp/gomplate
416-
curl -sSfL "https://github.com/hairyhenderson/gomplate/releases/download/v5.0.0/checksums-v5.0.0_sha256.txt" \
417-
-o /tmp/gomplate_checksums.txt
418-
echo "$(grep 'bin/gomplate_linux-amd64$' /tmp/gomplate_checksums.txt | awk '{print $1}') /tmp/gomplate" | sha256sum -c -
414+
GOMPLATE_VERSION="v5.0.0"
415+
GOMPLATE_RELEASE_URL="https://github.com/hairyhenderson/gomplate/releases/download/${GOMPLATE_VERSION}"
416+
417+
curl -sSfL "${GOMPLATE_RELEASE_URL}/gomplate_linux-amd64" \
418+
-o /tmp/gomplate || { echo "Failed to download gomplate binary"; exit 1; }
419+
curl -sSfL "${GOMPLATE_RELEASE_URL}/checksums-${GOMPLATE_VERSION}_sha256.txt" \
420+
-o /tmp/gomplate_checksums.txt || { echo "Failed to download gomplate checksums"; exit 1; }
421+
EXPECTED_SHA="$(grep 'bin/gomplate_linux-amd64$' /tmp/gomplate_checksums.txt | awk '{print $1}')"
422+
if [ -z "${EXPECTED_SHA}" ]; then
423+
echo "Unable to find checksum for gomplate_linux-amd64"
424+
exit 1
425+
fi
426+
echo "${EXPECTED_SHA} /tmp/gomplate" | sha256sum -c - || { echo "Gomplate checksum verification failed"; exit 1; }
419427
sudo install -m 755 /tmp/gomplate /usr/local/bin/gomplate
420428
421429
branding:

0 commit comments

Comments
 (0)