Add setup-gomplate input and install gomplate with checksum verification#51
Add setup-gomplate input and install gomplate with checksum verification#51andrewb1269 merged 3 commits intomainfrom
setup-gomplate input and install gomplate with checksum verification#51Conversation
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>
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>
setup-gomplate input and install gomplate with checksum verification
There was a problem hiding this comment.
Pull request overview
This PR adds optional gomplate setup support to the initialize-github-job composite action, including checksum-verified installation and CI coverage to validate the new feature.
Changes:
- Added a new
setup-gomplateinput (defaultfalse) and conditional gomplate install steps toaction.yml. - Implemented a checksum verification flow for downloading and installing gomplate
v5.0.0(Linux AMD64). - Extended CI workflow coverage to exercise
setup-gomplateand verifygomplate --version, plus added a dedicated gomplate job; updated README inputs/docs accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
action.yml |
Adds setup-gomplate input and Linux AMD64 gomplate download + checksum verification + install steps. |
README.md |
Documents the new setup-gomplate input and notes current Linux AMD64 scope. |
.github/workflows/test.yml |
Enables gomplate in the all-features workflow and adds a dedicated job verifying installation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| curl -sSfL "${GOMPLATE_RELEASE_URL}/gomplate_linux-amd64" \ | ||
| -o /tmp/gomplate || { echo "Failed to download gomplate binary"; exit 1; } | ||
| curl -sSfL "${GOMPLATE_RELEASE_URL}/checksums-${GOMPLATE_VERSION}_sha256.txt" \ | ||
| -o /tmp/gomplate_checksums.txt || { echo "Failed to download gomplate checksums"; exit 1; } | ||
| EXPECTED_SHA="$(grep 'bin/gomplate_linux-amd64$' /tmp/gomplate_checksums.txt | awk '{print $1}')" | ||
| if [ -z "${EXPECTED_SHA}" ]; then | ||
| echo "Unable to find checksum for gomplate_linux-amd64" |
There was a problem hiding this comment.
The checksum lookup is grepping for bin/gomplate_linux-amd64, but the downloaded asset name is gomplate_linux-amd64. Unless the upstream checksums file actually includes the bin/ prefix, this will make EXPECTED_SHA empty and the step will always fail. Consider matching the exact asset filename present in the checksums file (and/or supporting both formats) to make the verification reliable.
| curl -sSfL "${GOMPLATE_RELEASE_URL}/gomplate_linux-amd64" \ | |
| -o /tmp/gomplate || { echo "Failed to download gomplate binary"; exit 1; } | |
| curl -sSfL "${GOMPLATE_RELEASE_URL}/checksums-${GOMPLATE_VERSION}_sha256.txt" \ | |
| -o /tmp/gomplate_checksums.txt || { echo "Failed to download gomplate checksums"; exit 1; } | |
| EXPECTED_SHA="$(grep 'bin/gomplate_linux-amd64$' /tmp/gomplate_checksums.txt | awk '{print $1}')" | |
| if [ -z "${EXPECTED_SHA}" ]; then | |
| echo "Unable to find checksum for gomplate_linux-amd64" | |
| GOMPLATE_ASSET="gomplate_linux-amd64" | |
| curl -sSfL "${GOMPLATE_RELEASE_URL}/${GOMPLATE_ASSET}" \ | |
| -o /tmp/gomplate || { echo "Failed to download gomplate binary"; exit 1; } | |
| curl -sSfL "${GOMPLATE_RELEASE_URL}/checksums-${GOMPLATE_VERSION}_sha256.txt" \ | |
| -o /tmp/gomplate_checksums.txt || { echo "Failed to download gomplate checksums"; exit 1; } | |
| EXPECTED_SHA="$(awk -v asset="${GOMPLATE_ASSET}" '$2 == asset || $2 == "bin/" asset { print $1; exit }' /tmp/gomplate_checksums.txt)" | |
| if [ -z "${EXPECTED_SHA}" ]; then | |
| echo "Unable to find checksum for ${GOMPLATE_ASSET}" |
| - name: Install Gomplate | ||
| id: setup-gomplate | ||
| if: ${{ inputs.setup-gomplate == 'true' }} | ||
| shell: bash | ||
| run: | | ||
| GOMPLATE_VERSION="v5.0.0" | ||
| GOMPLATE_RELEASE_URL="https://github.com/hairyhenderson/gomplate/releases/download/${GOMPLATE_VERSION}" | ||
|
|
||
| curl -sSfL "${GOMPLATE_RELEASE_URL}/gomplate_linux-amd64" \ | ||
| -o /tmp/gomplate || { echo "Failed to download gomplate binary"; exit 1; } | ||
| curl -sSfL "${GOMPLATE_RELEASE_URL}/checksums-${GOMPLATE_VERSION}_sha256.txt" \ | ||
| -o /tmp/gomplate_checksums.txt || { echo "Failed to download gomplate checksums"; exit 1; } | ||
| EXPECTED_SHA="$(grep 'bin/gomplate_linux-amd64$' /tmp/gomplate_checksums.txt | awk '{print $1}')" | ||
| if [ -z "${EXPECTED_SHA}" ]; then | ||
| echo "Unable to find checksum for gomplate_linux-amd64" | ||
| exit 1 | ||
| fi | ||
| echo "${EXPECTED_SHA} /tmp/gomplate" | sha256sum -c - || { echo "Gomplate checksum verification failed"; exit 1; } | ||
| sudo install -m 755 /tmp/gomplate /usr/local/bin/gomplate |
There was a problem hiding this comment.
This install path is Linux/AMD64-specific (gomplate_linux-amd64, sha256sum, /usr/local/bin, sudo). If a workflow runs this composite action on macOS/Windows or non-amd64 Linux with setup-gomplate: true, it will fail in a non-obvious way. Consider adding an explicit runner.os / architecture guard with a clear error message (or skipping) to match the documented scope.
This issue requests support for gomplate setup in
initialize-github-job, following the referenced installation approach. This PR adds a dedicatedsetup-gomplatefield and wires in a checksum-verified install path for gomplate v5.0.0.Composite action updates
action.yml:setup-gomplate(default:false)setup-gomplate == 'true'sha256sum -c -/usr/local/bin/gomplateWorkflow coverage
.github/workflows/test.yml:setup-gomplatein the all-features job and verifiedgomplate --versiontest-setup-gomplatejob.Documentation
README.md:setup-gomplateto inputs