You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+91-52Lines changed: 91 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,18 @@
1
1
# update-flake-lock
2
2
3
-
This is a GitHub Action that will update your flake.lock file whenever it is run.
3
+
This is a GitHub Action that updates the [`flake.lock`][lockfile] file for your [Nix flake][flakes] whenever it is run.
4
4
5
-
> **NOTE:** As of v3, this action will no longer automatically install Nix to the action runner. You **MUST** set up a Nix with flakes support enabled prior to running this action, or your workflow will not function as expected.
5
+
> [!NOTE]
6
+
> As of v3, this action no longer automatically installs [Determinate Nix][det-nix] to the action runner.
7
+
> You **must** set up Nix with flakes support enabled prior to running this action or your workflow will not function as expected.
6
8
7
9
## Example
8
10
9
-
An example GitHub Action workflow using this action would look like the following:
11
+
Here's an example GitHub Action workflow using this Action:
> **NOTE**: If any inputs have a stale reference (e.g. the lockfile thinks a git input wants its "ref" to be "nixos-unstable", but the flake.nix specifies "nixos-unstable-small"), they will also be updated. At this time, there is no known workaround.
42
+
> [!NOTE]
43
+
> If any inputs have a stale reference (e.g. the lockfile thinks a git input wants its "ref" to be "nixos-unstable", but the flake.nix specifies "nixos-unstable-small"), they are also updated. At this time, there is no known workaround.
38
44
39
-
It is also possible to update specific inputs by specifying them in a space-separated list:
45
+
It's also possible to update specific [flake inputs][inputs] by specifying them in a space-separated list:
GitHub Actions will not run workflows when a branch is pushed by or a PR is opened by a GitHub Action. There are two ways to have GitHub Actions CI run on a PR submitted by this action.
188
+
GitHub Actions doesn't run workflows when a branch is pushed by or a PR is opened by a GitHub Action.
189
+
There are two ways to have GitHub Actions CI run on a PR submitted by this action.
172
190
173
191
### Without a Personal Authentication Token
174
192
175
193
Without using a Personal Authentication Token, close and reopen the pull request manually to kick off CI.
176
194
177
195
### With a Personal Authentication Token
178
196
179
-
By providing a Personal Authentication Token, the PR will be submitted in a way that bypasses this limitation (GitHub will essentially think it is the owner of the PAT submitting the PR, and not an Action).
197
+
By providing a Personal Authentication Token, the PR is submitted in a way that bypasses this limitation (GitHub essentially thinks it's the owner of the PAT submitting the PR, and not an Action).
180
198
You can create a token by visiting https://github.com/settings/tokens and select at least the `repo` scope. For the new fine-grained tokens, you need to enable read and write access for "Contents" and "Pull Requests" permissions. Then, store this token in your repository secrets (i.e. `https://github.com/<USER>/<REPO>/settings/secrets/actions`) as `GH_TOKEN_FOR_UPDATES` and set up your workflow file like the following:
It's possible for the bot to produce GPG signed commits. Associating a GPG public key to a github user account is not required but it is necessary if you want the signed commits to appear as verified in Github. This can be a compliance requirement in some cases.
225
+
It's possible for the bot to produce GPG-signed commits.
226
+
Associating a GPG public key to a GitHub user account isn't required but it *is* necessary if you want the signed commits to appear as verified in Github.
227
+
This can be a compliance requirement in some cases.
206
228
207
-
You can follow [Github's guide on creating and/or adding a new GPG key to an user account](https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-new-gpg-key-to-your-github-account). Using a specific github user account for the bot can be a good security measure to dissociate this bot's actions and commits from your personal github account.
229
+
You can follow [GitHub's guide to creating and/or adding a new GPG key to an user account](https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-new-gpg-key-to-your-github-account).
230
+
Using a specific GitHub user account for the bot can be a good security measure to dissociate this bot's actions and commits from your personal GitHub account.
208
231
209
-
For the bot to produce signed commits, you will have to provide the GPG private keys to this action's input parameters. You can safely do that with [Github secrets as explained here](https://github.com/crazy-max/ghaction-import-gpg#prerequisites).
232
+
For the bot to produce signed commits, you need to provide the GPG private keys to this action's input parameters. You can safely do that with [Github secrets as explained here](https://github.com/crazy-max/ghaction-import-gpg#prerequisites).
210
233
211
234
When using commit signing, the commit author name and email for the commits produced by this bot would correspond to the ones associated to the GPG Public Key.
212
235
213
236
If you want to sign using a subkey, you must specify the subkey fingerprint using the `gpg-fingerprint` input parameter.
214
237
215
-
You can find an example of how to using this action with commit signing below:
238
+
Here's an example of how to using this action with commit signing:
However you can customize it, with variable interpolation performed with [Handlebars](https://handlebarsjs.com/). This allows you to customize the template with the following variables:
268
-
- env.GIT_AUTHOR_NAME
269
-
- env.GIT_AUTHOR_EMAIL
270
-
- env.GIT_COMMITTER_NAME
271
-
- env.GIT_COMMITTER_EMAIL
272
-
- env.GIT_COMMIT_MESSAGE
294
+
You can customize it, however, using variable interpolation performed with [Handlebars].
295
+
This enables you to customize the template with these variables:
Feel free to send a PR or open an issue if you find something functions unexpectedly! Please make sure to test your changes and update any related documentation before submitting your PR.
334
+
Feel free to send a PR or open an issue if you find that something functions unexpectedly!
335
+
Please make sure to test your changes and update any related documentation before submitting your PR.
304
336
305
337
### How to test changes
306
338
307
-
In order to more easily test your changes to this action, we have created a template repository that should point you in the right direction: https://github.com/DeterminateSystems/update-flake-lock-test-template. Please see the README in that repository for instructions on testing your changes.
339
+
In order to more easily test your changes to this action, we have created a template repository that should point you in the right direction: https://github.com/DeterminateSystems/update-flake-lock-test-template.
340
+
Please see the README in that repository for instructions on testing your changes.
0 commit comments