update-flake-lock icon indicating copy to clipboard operation
update-flake-lock copied to clipboard

Support multiple flake directories

Open lucperkins opened this issue 1 year ago • 5 comments

We like the idea behind #98 but unfortunately we switched this Action to use JS instead of Bash, which means that implementing that would be a non-trivial amount of work for @DavHau so I've decided to go ahead and implement it on my own (given that I know our internal libs well).

lucperkins avatar May 23 '24 18:05 lucperkins

@davhau If you could give this a try in one of your repos, that would be great!

- uses: DeterminateSystems/update-flake-lock@multiple-flake-dirs-ts

lucperkins avatar May 28 '24 22:05 lucperkins

Thanks for this. Will test it tomorrow

DavHau avatar May 28 '24 23:05 DavHau

I've tested this out in an external repo: https://github.com/lucperkins/update-flake-lock-multiple-dirs

This run successfully created this PR (with sub-dirs subflake1 and subflake2).

There were two unsuccessful runs of the same workflow but that was solely related to improper permissions on the test repo. Changing the permissions resolved the issue.

lucperkins avatar Jun 03 '24 20:06 lucperkins

@cole-h The root flake.lock is only updated once because I added it after the two sub-dirs. As for the PR body, we are a bit constrained here by Actions' inputs (in this case the pr-body input). Those can't be dynamic and the best we can do is update the default value.

Update: okay, I see now that we have some flexibility with the templating so I'll update the pr-body default to be more descriptive.

lucperkins avatar Jun 03 '24 21:06 lucperkins

Yes, I know the root flake.lock is only updated once. However, if you look at your PR, the commit messages all say flake.lock: Update:

image

Whereas using nix flake update --commit-lock-file in a subdirectory will give you path/to/the/flake.lock: Update as the commit message.

This doesn't strike me as good UX, not being able to distinguish between which commit updated which flake.lock....

cole-h avatar Jun 03 '24 21:06 cole-h