Live data from Hacker News

Gh-actions-lockfile: generate and verify lockfiles for GitHub Actions

gh-actions-lockfile.net

11–20 of 28 posts

Re: Gh-actions-lockfile: generate and verify lockfiles for GitHub Actions

#11
TBH this discussion and the need for a lockfile for your CI makes me dizzy, is there something I'm missing wrt GHA that makes it awesome enough to be worth these tradeoffs?

For reference, I come from a Gitlab CI background and all I want is to specify a container, and the CI system should clone my repo in it and run some tests; perhaps optionally allow me to write stuff in a text file that can be displayed on the pull request or the commit (although Gitlab CI doesn't do that AFAIK). Is there something I'm missing due to which GHA architecture is so complicated?

Re: Gh-actions-lockfile: generate and verify lockfiles for GitHub Actions

#12

From what I see, this does not help with pinning the dependencies and it doesn’t verify the downloaded action has the same content as it used to have. In other words, this is a tiny patch on a big wound. We use commit hashes to pin actions, have the version as a comment (e.g # v4) and renovate will keep both up to date in the PRs. And there is a more or less recently added repository setting to require actions to be…

This is the way to do it.

Pin by hash.

Verify that the actions themselves aren't pulling in unpinned dependencies from Actions, NPM, or elsewhere.

Have a CI job or bot create PRs for new versions. Verify those PRs before merging.

If any particular action becomes a recurring chore or risk, consider if you should keep depending on it.

If you do these things, the "we need a package manager" is moot and most if not all of the concerns in that blog post don't affect you.

Re: Gh-actions-lockfile: generate and verify lockfiles for GitHub Actions

#13

Why do you need this? Just pin your actions to shasum

If that action itself has unpinned dependencies that doesn't accomplish much.

Don't use such actions. Or fork them and commit add the lockfile yourself, if you're cool with the implied maintenance.

Re: Gh-actions-lockfile: generate and verify lockfiles for GitHub Actions

#15

TBH this discussion and the need for a lockfile for your CI makes me dizzy, is there something I'm missing wrt GHA that makes it awesome enough to be worth these tradeoffs? For reference, I come from a Gitlab CI background and all I want is to specify a container, and the CI system should clone my repo in it and run some tests; perhaps optionally allow me to write stuff in a text file that can be displayed on the pul…

Maybe the few dozen developers not working on something that can be build with Linux only?

Re: Gh-actions-lockfile: generate and verify lockfiles for GitHub Actions

#16
post #12

From what I see, this does not help with pinning the dependencies and it doesn’t verify the downloaded action has the same content as it used to have. In other words, this is a tiny patch on a big wound. We use commit hashes to pin actions, have the version as a comment (e.g # v4) and renovate will keep both up to date in the PRs. And there is a more or less recently added repository setting to require actions to be…

This is the way to do it. Pin by hash. Verify that the actions themselves aren't pulling in unpinned dependencies from Actions, NPM, or elsewhere. Have a CI job or bot create PRs for new versions. Verify those PRs before merging. If any particular action becomes a recurring chore or risk, consider if you should keep depending on it. If you do these things, the "we need a package manager" is moot and most if not all o…

I don’t want to throw process at the problem. I think GH should provide a better system not the developers locking down dependencies and adding extra processes and steps to update the CI via a PR workflow. Not like PRs became the development bottleneck anyways for a lot of development teams these days. I wonder how we functioned 15 years ago with trunk based YOLO development. I also think that it wasn’t the best idea to base versioning on mutable branches and not introduce a registry in the middle. Think about it. The whole system is build on node anyways. But we pull “dependencies” via a weak git clone system.

Re: Gh-actions-lockfile: generate and verify lockfiles for GitHub Actions

#17

TBH this discussion and the need for a lockfile for your CI makes me dizzy, is there something I'm missing wrt GHA that makes it awesome enough to be worth these tradeoffs? For reference, I come from a Gitlab CI background and all I want is to specify a container, and the CI system should clone my repo in it and run some tests; perhaps optionally allow me to write stuff in a text file that can be displayed on the pul…

Yeah, GHA has a massive plugin ecosystem. A common pattern is using an “action” from a plugin as one CI step/job. So these are dependencies that get resolved at runtime when GHA puts together your workload.

Other CI platforms have plugins, but the “plugins” in GitHub really get used as the core primitive of the system, which is part of what makes it so simple & easy to use… for really basic workflows. You just hook up a couple actions like this and you’re good to go, no shell scripting required. (Though you can totally do that too.)

I mean at the end of the day, it’s a big part of the value proposition, even if I prefer a much more bare metal approach. GHA is really not great at massive CI workloads.

Re: Gh-actions-lockfile: generate and verify lockfiles for GitHub Actions

#18
Another (more complete? maintenance, security checks) solution is to allow renovatebot handle this for you. Enable this preset: https://docs.renovatebot.com/presets-helpers/#helperspingith...

..and in the next update cycle, you will see all actions be pinned like this:

- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6

Re: Gh-actions-lockfile: generate and verify lockfiles for GitHub Actions

#20
post #13

Earlier quoted context omitted.

If that action itself has unpinned dependencies that doesn't accomplish much.

Don't use such actions. Or fork them and commit add the lockfile yourself, if you're cool with the implied maintenance.

Sure, or we come up with a proper solution via lockfiles so we don't have keep forking and maintaining, and make full dependency locks the default so everyone benefits.

This is a long solved problem in every other ecosystem. This particular implementation isn't great but it has the right idea.

Post reply on HN