Skip to content

use RUNNER_TOOL_CACHE path to store cosign - #184

Draft
cpanato wants to merge 1 commit into
sigstore:mainfrom
cpanato:GH-183
Draft

cpanato wants to merge 1 commit into
sigstore:mainfrom
cpanato:GH-183

Conversation

@cpanato

@cpanato cpanato commented Mar 5, 2025

Copy link
Copy Markdown
Member

Summary

use RUNNER_TOOL_CACHE path to store cosign

Fixes: #183

@cpanato
cpanato marked this pull request as draft March 5, 2025 14:44
@cpanato
cpanato force-pushed the GH-183 branch 8 times, most recently from 63c1dd5 to 562cc9d Compare March 5, 2025 15:23
@cpanato
cpanato marked this pull request as ready for review March 5, 2025 15:23
@cpanato
cpanato requested a review from bobcallaway March 5, 2025 15:28
Comment thread action.yml Outdated
Signed-off-by: cpanato <ctadeu@gmail.com>
@cpanato

cpanato commented Jun 15, 2025

Copy link
Copy Markdown
Member Author

ping @haydentherapper @bobcallaway

@cpanato
cpanato requested a review from Hayden-IO June 15, 2025 16:05
Comment thread action.yml
install-dir:
description: 'Where to install the cosign binary'
required: false
default: '$HOME/.cosign'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this might have a breaking impact on folks if they're hardcoded the path, perhaps we should include a comment in the changelog about this

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes, we can add a comment and also bump the minor version of the action

Comment thread action.yml
export install_dir="$RUNNER_TOOL_CACHE/cosign/${{ inputs.cosign-release }}/${{ runner.arch }}"

if command -v "$install_dir/cosign" &> /dev/null; then
echo "Found Cosign in the cache $RUNNER_TOOL_CACHE"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

wdyt about printing the shasum of the binary that is found? I'm wondering about if someone were to "poison" the cache before our action is called, and we're simply just checking that a binary exists in that path instead of ensuring it is the "right" binary.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

sounds a great idea, will add another output

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the only other thought I have is to have the action to retain a full list of all checksums, and ensure the digest of the file matches our "database"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If that is something we don't want, we can just set it as won't fix it and keep as is

this is most relevant to self hosted runners

@cpanato
cpanato marked this pull request as draft June 16, 2025 16:12
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.

Support RUNNER_TOOL_CACHE for caching the cosign binary

4 participants