Skip to content

Add setup-gomplate input and install gomplate with checksum verification#51

Merged
andrewb1269 merged 3 commits intomainfrom
copilot/add-setup-gomplate-field
Apr 14, 2026
Merged

Add setup-gomplate input and install gomplate with checksum verification#51
andrewb1269 merged 3 commits intomainfrom
copilot/add-setup-gomplate-field

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

This issue requests support for gomplate setup in initialize-github-job, following the referenced installation approach. This PR adds a dedicated setup-gomplate field and wires in a checksum-verified install path for gomplate v5.0.0.

  • Composite action updates

    • Added new input in action.yml:
      • setup-gomplate (default: false)
    • Added conditional gomplate setup steps gated by setup-gomplate == 'true'
    • Implemented install flow aligned with the requested pattern:
      • download Linux AMD64 gomplate binary
      • download release checksum file
      • extract expected hash and verify with sha256sum -c -
      • install to /usr/local/bin/gomplate
    • Added explicit failure messages for download/checksum failure paths.
  • Workflow coverage

    • Extended .github/workflows/test.yml:
      • enabled setup-gomplate in the all-features job and verified gomplate --version
      • added a dedicated test-setup-gomplate job.
  • Documentation

    • Updated README.md:
      • added setup-gomplate to inputs
      • included gomplate in feature summary
      • documented current Linux AMD64 artifact scope.
with:
  setup-gomplate: true

Copilot AI linked an issue Apr 14, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add setup gomplate field Add setup-gomplate input and install gomplate with checksum verification Apr 14, 2026
Copilot AI requested a review from andrewb1269 April 14, 2026 20:02
@andrewb1269 andrewb1269 marked this pull request as ready for review April 14, 2026 20:12
Copilot AI review requested due to automatic review settings April 14, 2026 20:12
@andrewb1269 andrewb1269 merged commit ee6e09f into main Apr 14, 2026
26 checks passed
@andrewb1269 andrewb1269 deleted the copilot/add-setup-gomplate-field branch April 14, 2026 20:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-gomplate input (default false) and conditional gomplate install steps to action.yml.
  • Implemented a checksum verification flow for downloading and installing gomplate v5.0.0 (Linux AMD64).
  • Extended CI workflow coverage to exercise setup-gomplate and verify gomplate --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.

Comment on lines +416 to +423

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"
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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}"

Copilot uses AI. Check for mistakes.
Comment on lines +409 to +427
- 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
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add setup gomplate field

4 participants