-
Notifications
You must be signed in to change notification settings - Fork 0
Add setup-gomplate input and install gomplate with checksum verification
#51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,6 +120,10 @@ inputs: | |
| description: 'Whether to setup Task' | ||
| required: false | ||
| default: 'false' | ||
| setup-gomplate: | ||
| description: 'Whether to setup gomplate' | ||
| required: false | ||
| default: 'false' | ||
| task-version: | ||
| description: 'Task version to use' | ||
| required: false | ||
|
|
@@ -393,6 +397,35 @@ runs: | |
| repo-token: ${{ inputs.checkout-token }} | ||
| max-retries: ${{ inputs.task-retries }} | ||
|
|
||
| - name: Set Up Gomplate Parameters | ||
| id: setup-gomplate-params | ||
| if: ${{ inputs.setup-gomplate == 'true' }} | ||
| shell: bash | ||
| run: | | ||
| echo "::group::Setting up gomplate" | ||
| echo "Version: v5.0.0" | ||
| echo "::endgroup::" | ||
|
|
||
| - 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 | ||
|
Comment on lines
+409
to
+427
|
||
|
|
||
| branding: | ||
| icon: 'arrow-up-right' | ||
| color: 'green' | ||
There was a problem hiding this comment.
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 isgomplate_linux-amd64. Unless the upstream checksums file actually includes thebin/prefix, this will makeEXPECTED_SHAempty 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.