Skip to content

Hash action versions#963

Merged
tmadlener merged 6 commits intoAIDASoft:masterfrom
tmadlener:hash-action-versions
Apr 17, 2026
Merged

Hash action versions#963
tmadlener merged 6 commits intoAIDASoft:masterfrom
tmadlener:hash-action-versions

Conversation

@tmadlener
Copy link
Copy Markdown
Collaborator

BEGINRELEASENOTES

  • Pin all used github actions to the commit that corresponds to the latest released tag

ENDRELEASENOTES

Doing this in favor of just bumping versions as originally proposed by dependabot

@jmcarcell
Copy link
Copy Markdown
Member

jmcarcell commented Apr 17, 2026

Dependabot alerts don't work with hashes: https://docs.github.com/en/code-security/concepts/supply-chain-security/about-dependabot-alerts#limitations
Plus anyway if the repository has been compromised how do you know that commit is not? I'm not convinced hashes are much better than versions.

@m-fila
Copy link
Copy Markdown
Contributor

m-fila commented Apr 17, 2026

What is the reason to do so? If you want to pin explicit version you can do "v6.3.1" - the convention is not to update these

@jmcarcell
Copy link
Copy Markdown
Member

Security, tags are not immutable. It seems the best practice is to pin to a hash: https://docs.github.com/en/actions/reference/security/secure-use#using-third-party-actions but then you don't get dependabot security alerts? 🤔

@m-fila
Copy link
Copy Markdown
Contributor

m-fila commented Apr 17, 2026

Ah I see. Then unfortunately no dependabot here 😝
If I'm not mistaken this repo has only official actions, actions by credible sources (cvmfs) or "3rd parties" which are controlled by people with write access to this repo anyway

@andresailer
Copy link
Copy Markdown
Member

Plus anyway if the repository has been compromised how do you know that commit is not?

At least the content of the commit doesn't change (until someone finds a way for hash collisions...), while it can change for tags. So this is maybe not really needed for where we put them, but we might as well just go for hashes everywhere as a principle.

If I'm not mistaken this repo has only official actions, actions by credible sources (cvmfs) or "3rd parties" which are controlled by people with write access to this repo anyway

Security in depth!

- uses: cvmfs-contrib/github-action-cvmfs@v5
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: cvmfs-contrib/github-action-cvmfs@10197e000cc0add8e54ac4fb73d3ed44e2de72b4
- uses: key4hep/key4hep-actions/cache-external-data@main
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.

What about this action?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good question (also for other repositories). We currently don't even tag this I think.

@m-fila
Copy link
Copy Markdown
Contributor

m-fila commented Apr 17, 2026

Dependabot alerts don't work with hashes: https://docs.github.com/en/code-security/concepts/supply-chain-security/about-dependabot-alerts#limitations

Wait, the updates seem to work with hashes no? https://docs.github.com/en/code-security/reference/supply-chain-security/supported-ecosystems-and-repositories?utm_source=chatgpt.com#github-actions

For example, here in TBB they pin by hash and have comment, and they get an update uxlfoundation/oneTBB#2037

The docs you mentioned were about dependabot alerts which are different thing from dependaboty version updates. (which means that if a vulnerability is detected in the version but we pin it with hash not tag then there won't be an alert)

@tmadlener
Copy link
Copy Markdown
Collaborator Author

Wait, the updates seem to work with hashes no? https://docs.github.com/en/code-security/reference/supply-chain-security/supported-ecosystems-and-repositories?utm_source=chatgpt.com#github-actions

IIUC, we could also do this to track which tag we are tracking and dependabot would automatically update the comment as well(?)

- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #6.0.2

@m-fila
Copy link
Copy Markdown
Contributor

m-fila commented Apr 17, 2026

That is my understanding as well

@tmadlener tmadlener force-pushed the hash-action-versions branch from e7e7dc4 to 2a4d0eb Compare April 17, 2026 11:52
@jmcarcell
Copy link
Copy Markdown
Member

jmcarcell commented Apr 17, 2026

There is also this in Settings -> Advanced security (disabled by default):

Dependabot security updates

Enabling this option will result in Dependabot automatically attempting to open pull requests to resolve every open Dependabot alert with an available patch. If you would like more specific configuration options, leave this disabled and use Dependabot rules.

This should be probably updated? But if there are no alerts when using commits does this work? Also alerts is disabled by default

@m-fila
Copy link
Copy Markdown
Contributor

m-fila commented Apr 17, 2026

IIUC, we could also do this to track which tag we are tracking and dependabot would automatically update the comment as well(?)

I checked on some other repo and indeed it seems to work out of the box

@tmadlener
Copy link
Copy Markdown
Collaborator Author

Dependabot alerts are enabled for podio. We get some fixes for the doc/requirements.txt from time to time from that.

@jmcarcell
Copy link
Copy Markdown
Member

jmcarcell commented Apr 17, 2026

The security ones are disabled:

2026-04-17-143936_1288x116_scrot

but these will not work anyway with hashes (docs say so).

@tmadlener
Copy link
Copy Markdown
Collaborator Author

tmadlener commented Apr 17, 2026

Ah, now I get what you mean. But if we get auto-updates in any case, does it matter too much whether the update has been triggered by a security issue or by something else?

edit:

The security ones are disabled:

The screenshot you put says that they are enabled and that we could disable them with the button.

@tmadlener
Copy link
Copy Markdown
Collaborator Author

I would merge these as is, unless there are more comments. We can decide what to do with our own key4hep-action in a separate PR, I think.

@tmadlener tmadlener enabled auto-merge (squash) April 17, 2026 14:06
@tmadlener tmadlener disabled auto-merge April 17, 2026 14:06
@tmadlener tmadlener merged commit 6ef2f5b into AIDASoft:master Apr 17, 2026
26 checks passed
@tmadlener tmadlener deleted the hash-action-versions branch April 17, 2026 14:06
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.

4 participants