File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
421429branding :
You can’t perform that action at this time.
0 commit comments