Skip to content

Comments

Hash-pin GitHub Actions, use dependabot to update them#56211

Merged
jakebailey merged 5 commits intomicrosoft:mainfrom
pnacht:pinned-github-actions
Oct 26, 2023
Merged

Hash-pin GitHub Actions, use dependabot to update them#56211
jakebailey merged 5 commits intomicrosoft:mainfrom
pnacht:pinned-github-actions

Conversation

@pnacht
Copy link
Contributor

@pnacht pnacht commented Oct 24, 2023

Fixes #55216.

This PR hash-pins almost all GitHub Actions. The only exception is microsoft/TypeScript-Twoslash-Repro-Action, which has no tags or release branches, and must therefore remain @master.

The PR also adds Dependabot to keep the Action hashes (and associated version comments) up-to-date. It is configured to send a single monthly PR updating all Actions at once. If you'd rather change the update cadence (weekly, for example) or create smaller logical groups of Actions, let me know and I'll update the config.

Signed-off-by: Pedro Kaj Kjellerup Nacht <[email protected]>
Signed-off-by: Pedro Kaj Kjellerup Nacht <[email protected]>
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Oct 24, 2023
Signed-off-by: Pedro Kaj Kjellerup Nacht <[email protected]>
@pnacht pnacht changed the title Pinned GitHub actions Hash-pin GitHub Actions, use dependabot to update them Oct 24, 2023
@jakebailey
Copy link
Member

I think I'd prefer weekly; monthly seems a little too spread out.

Overall I think the worst thing about pinning is how it's a pain to update locally if you need some feature "now"; I'm not aware of any tool one can run that updates things to this format (which dependabot and renovate both use). I pin actions on my repos and use renovate, but I'm also happy to have loads of PR noise that I don't wish to bestow on the team 😄

@jakebailey
Copy link
Member

jakebailey commented Oct 24, 2023

As for TypeScript-Twoslash-Repro-Action, can it not pin at <hash> # master? Then again, that's code we own, and it'd be a pain to not get updates there in short order when we change it.

Signed-off-by: Pedro Kaj Kjellerup Nacht <[email protected]>
Signed-off-by: Pedro Kaj Kjellerup Nacht <[email protected]>
@pnacht
Copy link
Contributor Author

pnacht commented Oct 26, 2023

I think I'd prefer weekly; monthly seems a little too spread out.

Done!

As for TypeScript-Twoslash-Repro-Action, can it not pin at <hash> # master? Then again, that's code we own, and it'd be a pain to not get updates there in short order when we change it.

Yes, absolutely. Done!

I was just concerned it'd create too much noise. But given that we're using grouped PRs for all Actions, it actually isn't a problem, especially since the Action's repo isn't very active.

But yeah, if there's any new features you think will be useful for TypeScript, you'll either need to wait a week for the dependabot PR or manually update the hash, which can be a bit of a hassle.

If you prefer, I can revert that change and leave it @master.

@jakebailey
Copy link
Member

Let's stick with pinned for now, and if it's a problem it's easy to go back. I agree that the other repo isn't extremely trafficked at the moment though there's some recent stuff I wanted to change there.

@jakebailey jakebailey merged commit 2432432 into microsoft:main Oct 26, 2023
@diogoteles08
Copy link

diogoteles08 commented Nov 14, 2023

Hey @jakebailey ,

Overall I think the worst thing about pinning is how it's a pain to update locally if you need some feature "now"; I'm not aware of any tool one can run that updates things to this format (which dependabot and renovate both use).

I'm not 100% sure I understood your complain, but renovate bot have a feature that "triggers" it to run again and check for new updates "now". Is that what you're looking for? See an example of this trigger at this issue of one testing repo of mine. The trigger is at the bottom.

@jakebailey
Copy link
Member

I use renovate on my personal projects (but IIRC we don't have the ability to do so in this org), but what I'm looking for specifically is a tool that I can run locally that does what renovate or dependabot do. Both are far too intertwined into GitHub or a PR flow for them to work (I've tried!). The closest tool I've found is https://github.com/mheap/pin-github-action, but it uses its own bespoke version format string.

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hash-pin workflow dependencies, keep them updated with Dependabot

4 participants