Compare commits

...

136 commits
v17 ... main

Author SHA1 Message Date
Luc Perkins
68fc9d463e
Merge pull request #172 from DeterminateSystems/determinate-nix-example
Some checks failed
CI / typescript-action (push) Has been cancelled
CI / validate (push) Has been cancelled
Use Determinate Nix in examples
2025-04-18 20:59:48 -03:00
Luc Perkins
8df4e70f64
Merge branch 'main' into determinate-nix-example 2025-04-18 17:49:37 -03:00
Luc Perkins
ad4544a038
Use Determinate Nix in examples 2025-04-18 15:23:17 -03:00
Luc Perkins
f258f6b8ca
Merge pull request #170 from DeterminateSystems/update_flake_lock_action
Some checks are pending
CI / typescript-action (push) Waiting to run
CI / validate (push) Waiting to run
flake.lock: Update
2025-04-18 15:07:42 -03:00
Luc Perkins
149faa1ed4
Merge branch 'main' into update_flake_lock_action 2025-04-18 15:06:35 -03:00
Luc Perkins
84feadbac6
Merge pull request #171 from detsys-pr-bot/detsys-ts-update-f42f6003b4044fede4681778f76342e523671e8f
Some checks failed
CI / typescript-action (push) Has been cancelled
CI / validate (push) Has been cancelled
Update `detsys-ts`: Merge pull request #89 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-0b8d2803d6
2025-04-13 23:45:02 -03:00
lucperkins
867f274467 Update detsys-ts for: Merge pull request #89 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-0b8d2803d6 (f42f6003b4044fede4681778f76342e523671e8f) 2025-04-14 02:29:57 +00:00
github-actions[bot]
605b78f787 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.770807%2Brev-a84ebe20c6bc2ecbcfb000a50776219f48d134cc/0195b626-8c1d-7fb9-9282-563af3d37ab9/source.tar.gz?narHash=sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ%3D' (2025-03-19)
  → 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.781462%2Brev-f675531bc7e6657c10a18b565cfebd8aa9e24c14/019624ad-56cd-7f8b-93ed-52e57165b6b6/source.tar.gz?narHash=sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U%3D' (2025-04-09)
2025-04-13 00:25:51 +00:00
Luc Perkins
1a5f8176b6
Merge pull request #169 from detsys-pr-bot/detsys-ts-update-b74bedb84e9116fefbbfd723260f374080249d48
Some checks failed
CI / typescript-action (push) Has been cancelled
CI / validate (push) Has been cancelled
Update `detsys-ts`: Merge pull request #88 from DeterminateSystems/dependabot/npm_and_yarn/npm_and_yarn-b7c6efa8f1
2025-04-11 13:10:07 -03:00
lucperkins
43e7b633e9 Update detsys-ts for: Merge pull request #88 from DeterminateSystems/dependabot/npm_and_yarn/npm_and_yarn-b7c6efa8f1 (b74bedb84e9116fefbbfd723260f374080249d48) 2025-04-11 16:08:49 +00:00
Luc Perkins
7689af81f5
Merge pull request #168 from detsys-pr-bot/detsys-ts-update-e31aa55518cae49b58723c152c6d0e46ee223ec1
Some checks failed
CI / typescript-action (push) Has been cancelled
CI / validate (push) Has been cancelled
Update `detsys-ts`: Merge pull request #87 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-2f3c1638ee
2025-04-06 22:27:06 -03:00
lucperkins
b81e46d8dd Update detsys-ts for: Merge pull request #87 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-2f3c1638ee (e31aa55518cae49b58723c152c6d0e46ee223ec1) 2025-04-07 01:17:09 +00:00
Graham Christensen
edf12a038d
Merge pull request #167 from detsys-pr-bot/detsys-ts-update-dc7c6d9c7a5d2db79ddc6eccf57d5fc09a391347
Some checks failed
CI / typescript-action (push) Has been cancelled
CI / validate (push) Has been cancelled
Update `detsys-ts`: Merge pull request #86 from DeterminateSystems/dependabot/npm_and_yarn/npm_and_yarn-2bd33993d4
2025-04-04 12:20:55 -04:00
lucperkins
97278a027b Update detsys-ts for: Merge pull request #86 from DeterminateSystems/dependabot/npm_and_yarn/npm_and_yarn-2bd33993d4 (dc7c6d9c7a5d2db79ddc6eccf57d5fc09a391347) 2025-04-04 16:19:32 +00:00
Graham Christensen
062b9f53fa
Merge pull request #166 from detsys-pr-bot/detsys-ts-update-79634332de50a2cde17cf8d6fe41258af3d4bedf
Some checks failed
CI / validate (push) Has been cancelled
CI / typescript-action (push) Has been cancelled
Update `detsys-ts`: Bump vite from 6.2.3 to 6.2.4 in the npm_and_yarn group (#85)
2025-03-31 16:30:23 -04:00
grahamc
84d025eee7 Update detsys-ts for: Bump vite from 6.2.3 to 6.2.4 in the npm_and_yarn group (#85) (79634332de50a2cde17cf8d6fe41258af3d4bedf) 2025-03-31 19:40:03 +00:00
Graham Christensen
2eaf7beabb
Merge pull request #165 from detsys-pr-bot/detsys-ts-update-3ef4baee587df9fe98f70036386e361fa0d6dc7e
Some checks are pending
CI / typescript-action (push) Waiting to run
CI / validate (push) Waiting to run
Update `detsys-ts`: Merge pull request #84 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-73588cc3c5
2025-03-31 08:52:32 -04:00
lucperkins
2a1e64c750 Update detsys-ts for: Merge pull request #84 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-73588cc3c5 (3ef4baee587df9fe98f70036386e361fa0d6dc7e) 2025-03-31 02:51:54 +00:00
Graham Christensen
c319d26b5f
Merge pull request #164 from DeterminateSystems/dependabot/github_actions/crazy-max/ghaction-import-gpg-6.3.0
Some checks are pending
CI / typescript-action (push) Waiting to run
CI / validate (push) Waiting to run
build(deps): bump crazy-max/ghaction-import-gpg from 6.2.0 to 6.3.0
2025-03-30 21:52:52 -04:00
dependabot[bot]
37001efe5b
build(deps): bump crazy-max/ghaction-import-gpg from 6.2.0 to 6.3.0
Bumps [crazy-max/ghaction-import-gpg](https://github.com/crazy-max/ghaction-import-gpg) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/crazy-max/ghaction-import-gpg/releases)
- [Commits](cb9bde2e25...e89d40939c)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-import-gpg
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-31 01:42:56 +00:00
Graham Christensen
f319391080
Merge pull request #163 from detsys-pr-bot/detsys-ts-update-07c7fc924119a8d9879c1c164ae593049d47f648
Some checks failed
CI / validate (push) Has been cancelled
CI / typescript-action (push) Has been cancelled
Update `detsys-ts`: Ignore hyphen-sep'd diags (#83)
2025-03-28 13:50:47 -04:00
grahamc
7f50ffb42b Update detsys-ts for: Ignore hyphen-sep'd diags (#83) (07c7fc924119a8d9879c1c164ae593049d47f648) 2025-03-28 17:47:57 +00:00
Graham Christensen
c6435de337
Merge pull request #162 from detsys-pr-bot/detsys-ts-update-03533d37dcd46f34d9e99385e665615b221a30d9
Update `detsys-ts`: Merge pull request #82 from DeterminateSystems/even-more-crashes
2025-03-28 10:19:29 -04:00
grahamc
01b415ecee Update detsys-ts for: Merge pull request #82 from DeterminateSystems/even-more-crashes (03533d37dcd46f34d9e99385e665615b221a30d9) 2025-03-28 14:10:22 +00:00
Graham Christensen
42aa906d7f
Merge pull request #161 from detsys-pr-bot/detsys-ts-update-8d9725c4856301321cd2508f5b8725cfb99366e2
Some checks are pending
CI / typescript-action (push) Waiting to run
CI / validate (push) Waiting to run
Update `detsys-ts`: Merge pull request #81 from DeterminateSystems/dont-capture-some-crashes
2025-03-27 12:00:09 -04:00
grahamc
8b0105d445 Update detsys-ts for: Merge pull request #81 from DeterminateSystems/dont-capture-some-crashes (8d9725c4856301321cd2508f5b8725cfb99366e2) 2025-03-27 15:57:16 +00:00
Luc Perkins
9e4b6cbbef
Merge pull request #160 from detsys-pr-bot/detsys-ts-update-38df301720b69972f084538dd44c181269f264b0
Update `detsys-ts`: Merge pull request #80 from DeterminateSystems/fixup-traces
2025-03-27 11:09:14 -03:00
grahamc
43a3cfc807 Update detsys-ts for: Merge pull request #80 from DeterminateSystems/fixup-traces (38df301720b69972f084538dd44c181269f264b0) 2025-03-27 13:47:43 +00:00
Graham Christensen
97b24ed38a
Merge pull request #159 from DeterminateSystems/esbuild
Some checks failed
CI / typescript-action (push) Has been cancelled
CI / validate (push) Has been cancelled
pnpm update, vitest
2025-03-26 11:32:24 -04:00
Graham Christensen
c7af1d9132 pnpm update, vitest 2025-03-26 11:18:26 -04:00
Luc Perkins
ae207e3462
Merge pull request #158 from detsys-pr-bot/detsys-ts-update-cf33e9577ca7571bf9ebbfe298b4e3e457a58813
Update `detsys-ts`: Merge pull request #79 from DeterminateSystems/dependabot/npm_and_yarn/npm_and_yarn-14f44f5325
2025-03-26 09:59:58 -03:00
lucperkins
6b57c8dc27 Update detsys-ts for: Merge pull request #79 from DeterminateSystems/dependabot/npm_and_yarn/npm_and_yarn-14f44f5325 (cf33e9577ca7571bf9ebbfe298b4e3e457a58813) 2025-03-26 12:31:56 +00:00
Luc Perkins
e680567e78
Merge pull request #157 from DeterminateSystems/flakehub-cache-action
Some checks failed
CI / typescript-action (push) Has been cancelled
CI / validate (push) Has been cancelled
2025-03-24 15:51:20 -03:00
Luc Perkins
6981b122f5
Merge pull request #155 from DeterminateSystems/update_flake_lock_action
Some checks are pending
CI / typescript-action (push) Waiting to run
CI / validate (push) Waiting to run
flake.lock: Update
2025-03-24 15:13:29 -03:00
Luc Perkins
1666ee39f3
Reformat and regenerate 2025-03-24 15:12:06 -03:00
Luc Perkins
6530cb6c3e
Merge remote-tracking branch 'origin/main' into update_flake_lock_action 2025-03-24 15:10:43 -03:00
Luc Perkins
3a90118afa
Switch to flakehub-cache-action 2025-03-24 00:52:44 -03:00
Luc Perkins
460b95a768
Merge pull request #156 from detsys-pr-bot/detsys-ts-update-9d2b0e4636787bba8b886ddc720f007850e541fb
Some checks are pending
CI / typescript-action (push) Waiting to run
CI / validate (push) Waiting to run
Update `detsys-ts`: Merge pull request #78 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-0af3b8ec11
2025-03-24 00:50:40 -03:00
lucperkins
ae18c965c1 Update detsys-ts for: Merge pull request #78 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-0af3b8ec11 (9d2b0e4636787bba8b886ddc720f007850e541fb) 2025-03-24 01:42:29 +00:00
github-actions[bot]
1d8d1b0210 flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.614481%2Brev-5c24cf2f0a12ad855f444c30b2421d044120c66f/018efa00-a443-7f41-b371-ce568b5c7e9f/source.tar.gz?narHash=sha256-XtTSSIB2DA6tOv%2Bl0FhvfDMiyCmhoRbNB%2B0SeInZkbk%3D' (2024-04-19)
  → 'https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.770807%2Brev-a84ebe20c6bc2ecbcfb000a50776219f48d134cc/0195b626-8c1d-7fb9-9282-563af3d37ab9/source.tar.gz?narHash=sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ%3D' (2025-03-19)
2025-03-23 00:02:08 +00:00
Graham Christensen
d58eff8f1d
Merge pull request #152 from detsys-pr-bot/detsys-ts-update-4c7ff9706e6466d7c03c58a3479ed212d6ffb5ba
Some checks failed
CI / typescript-action (push) Has been cancelled
CI / validate (push) Has been cancelled
Update `detsys-ts`: Merge pull request #74 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-eb3d92718e
2025-03-19 17:26:39 -04:00
grahamc
8d81dfe006 Update detsys-ts for: Merge pull request #74 from DeterminateSystems/dependabot/npm_and_yarn/npm-deps-eb3d92718e (4c7ff9706e6466d7c03c58a3479ed212d6ffb5ba) 2025-03-19 21:20:59 +00:00
Graham Christensen
f71609bc55
Merge pull request #138 from DeterminateSystems/dependabot/github_actions/crazy-max/ghaction-import-gpg-6.2.0
build(deps): bump crazy-max/ghaction-import-gpg from 6.1.0 to 6.2.0
2025-03-19 16:14:03 -04:00
Graham Christensen
a522afcccd
Merge pull request #149 from detsys-pr-bot/detsys-ts-update-c54767c24f0861de794605b03ed5604546d4a337
Update `detsys-ts`: Merge pull request #72 from DeterminateSystems/dependabot
2025-03-19 16:13:04 -04:00
grahamc
8368f542ad Update detsys-ts for: Merge pull request #72 from DeterminateSystems/dependabot (c54767c24f0861de794605b03ed5604546d4a337) 2025-03-19 20:11:07 +00:00
Graham Christensen
86cbeff68e
Merge pull request #148 from DeterminateSystems/simpler-instructions
Update the text with much simpler 'run ci' instructions.
2025-03-19 12:26:28 -04:00
Graham Christensen
e64717fb04
Update action.yml
Co-authored-by: Cole Helbling <cole.helbling@determinate.systems>
2025-03-19 12:25:15 -04:00
Graham Christensen
d99e45a16b Update the text with much simpler 'run ci' instructions. 2025-03-19 12:13:08 -04:00
Graham Christensen
208d8b0fa4
Merge pull request #146 from detsys-pr-bot/detsys-ts-update-b3319a2c78c46d5ad6bc00d3453266d3d9fdde44
Some checks failed
CI / typescript-action (push) Has been cancelled
CI / validate (push) Has been cancelled
Update `detsys-ts`: Merge pull request #71 from DeterminateSystems/updates
2025-02-06 11:49:44 -05:00
grahamc
183c83b4bc Update detsys-ts for: Merge pull request #71 from DeterminateSystems/updates (b3319a2c78c46d5ad6bc00d3453266d3d9fdde44) 2025-02-06 16:47:41 +00:00
Graham Christensen
0ba1118664
Merge pull request #144 from detsys-pr-bot/detsys-ts-update-eb87094f35072ac911526ad052c3437c9e0c42d6
Some checks failed
CI / typescript-action (push) Has been cancelled
CI / validate (push) Has been cancelled
Update `detsys-ts`: Merge pull request #69 from DeterminateSystems/update-deps
2024-11-26 11:31:58 -05:00
grahamc
236c0fa397 Update detsys-ts for: Merge pull request #69 from DeterminateSystems/update-deps (eb87094f35072ac911526ad052c3437c9e0c42d6) 2024-11-20 18:57:29 +00:00
Graham Christensen
8fa6d41e3f
Merge pull request #141 from DeterminateSystems/colemickens/pr-url
action.yml: expose pull-request-url from create-pr action
2024-11-08 14:50:46 -05:00
Cole Mickens
1360662aa3 action.yml: expose pull-request-url from create-pr action 2024-11-08 11:34:36 -08:00
Graham Christensen
531bd45244
Merge pull request #139 from detsys-pr-bot/detsys-ts-update-4280bc94c9545f31ccf08001cc16f20ccb91b770
Update `detsys-ts`: Merge pull request #67 from DeterminateSystems/allow-obliterating-id-token-privs
2024-11-06 14:56:02 -05:00
grahamc
1afac295f9 Update detsys-ts for: Merge pull request #67 from DeterminateSystems/allow-obliterating-id-token-privs (4280bc94c9545f31ccf08001cc16f20ccb91b770) 2024-11-06 19:43:49 +00:00
dependabot[bot]
1cc1733537
build(deps): bump crazy-max/ghaction-import-gpg from 6.1.0 to 6.2.0
Bumps [crazy-max/ghaction-import-gpg](https://github.com/crazy-max/ghaction-import-gpg) from 6.1.0 to 6.2.0.
- [Release notes](https://github.com/crazy-max/ghaction-import-gpg/releases)
- [Commits](01dd5d3ca4...cb9bde2e25)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-import-gpg
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-28 01:50:01 +00:00
dependabot[bot]
965531f332
build(deps-dev): bump vite from 5.2.12 to 5.4.6 (#131)
* build(deps-dev): bump vite from 5.2.12 to 5.4.6

Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.2.12 to 5.4.6.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.6/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.6/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* pnpm i

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cole Helbling <cole.helbling@determinate.systems>
2024-09-19 16:42:07 +00:00
Graham Christensen
a2bbe0274e
Merge pull request #128 from detsys-pr-bot/detsys-ts-update-65dd73c562ac60a068340f8e0c040bdcf2c59afe
Update `detsys-ts`: Merge pull request #63 from DeterminateSystems/retry-streams
2024-09-04 14:14:50 -04:00
grahamc
802501548e Update detsys-ts for: Merge pull request #63 from DeterminateSystems/retry-streams (65dd73c562ac60a068340f8e0c040bdcf2c59afe) 2024-09-04 18:05:28 +00:00
Graham Christensen
7d80c329b4
Merge pull request #126 from detsys-pr-bot/detsys-ts-update-817e4d4123b6fb4eae5aa557658f25f8539e7240
Update `detsys-ts`: Merge pull request #62 from DeterminateSystems/dont-pull-microstackshots
2024-08-26 19:46:57 -04:00
grahamc
7bc6ec59cc Update detsys-ts for: Merge pull request #62 from DeterminateSystems/dont-pull-microstackshots (817e4d4123b6fb4eae5aa557658f25f8539e7240) 2024-08-26 15:26:03 +00:00
Graham Christensen
4cf6b19203
Merge pull request #125 from detsys-pr-bot/detsys-ts-update-e8f6e8f54d85aa0fd3d0b694dd3279a21497a33b
Update `detsys-ts`: Merge pull request #61 from DeterminateSystems/use-coalesce-for-array
2024-08-26 10:09:12 -04:00
grahamc
73ba0ca899 Update detsys-ts for: Merge pull request #61 from DeterminateSystems/use-coalesce-for-array (e8f6e8f54d85aa0fd3d0b694dd3279a21497a33b) 2024-08-26 14:05:27 +00:00
Graham Christensen
24f53daa86
Merge pull request #124 from detsys-pr-bot/detsys-ts-update-cf1897a891edc164a8240f469cd56d14364e6be1
Update `detsys-ts`: Merge pull request #58 from DeterminateSystems/collect-crash-logs
2024-08-26 09:41:53 -04:00
grahamc
420fb2aaf7 Update detsys-ts for: Merge pull request #58 from DeterminateSystems/collect-crash-logs (cf1897a891edc164a8240f469cd56d14364e6be1) 2024-08-26 13:31:25 +00:00
Cole Helbling
db4ee38117 Fixup support for Nix 2.23.0 and later 2024-06-28 14:11:30 -07:00
Pierre Penninckx
b0723e0fae Add instructions for new fine grained GitHub PAT 2024-06-18 09:23:51 -07:00
Arian van Putten
af9a980c7d Lock third-party actions
A caller of this action can lock this action to a specific commit. However because the action itself does not lock its dependent actions to a specific commit this opens the end-user up to possible supply-chain attacks if the dependent actions rewrite their tags.

This PR changes all third party actions to be explicitly locked.

Dependabot will still work and update these hashes for you


I also suggest installing https://github.com/ossf/scorecard in this repo. It will report about these kind of issues.

Note that you should in turn have to audit all the third party deps of the actions that your action depends on. In general this is all a bit of a mess and GitHub's security model is very meh

e.g. see https://github.com/ossf/scorecard/issues/2189
2024-06-18 09:17:15 -07:00
Luc Perkins
ed0fe829d8
Merge pull request #115 from detsys-pr-bot/detsys-ts-update-bc45b6c0a6318ae30192c4bf23a73dc879bdb632
Update `detsys-ts`:
2024-06-05 16:19:34 -07:00
Luc Perkins
278b2c0e02
Merge pull request #114 from detsys-pr-bot/detsys-ts-update-515d00bc192ae4460e2122572ebc24020c58ea95
Update detsys-ts: Merge pull request #51 from DeterminateSystems/add-missing-actions-to-update-matrix

Add missing Actions to update matrix
2024-06-05 15:48:14 -07:00
Luc Perkins
1b00b724a5
Regenerate dist 2024-06-05 15:46:52 -07:00
Graham Christensen
23e86b41e2
Merge pull request #116 from detsys-pr-bot/detsys-ts-update-856a75af22949b76e23f6e54a1b4d27d8816cea4
Update `detsys-ts`: Merge pull request #113 from DeterminateSystems/update-detsys-ts-status-page
2024-06-05 18:06:07 -04:00
lucperkins
b8b46eb7bb Update detsys-ts for: Merge pull request #113 from DeterminateSystems/update-detsys-ts-status-page (856a75af22949b76e23f6e54a1b4d27d8816cea4) 2024-06-05 21:59:53 +00:00
lucperkins
50c97e1435 Update detsys-ts for: ` (bc45b6c0a6318ae30192c4bf23a73dc879bdb632`) 2024-06-05 21:32:11 +00:00
lucperkins
d777dd2ba4 Update detsys-ts for: Merge pull request #51 from DeterminateSystems/add-missing-actions-to-update-matrix
Add missing Actions to update matrix (515d00bc192ae4460e2122572ebc24020c58ea95)
2024-06-05 21:06:52 +00:00
Luc Perkins
bba6a453b7
Merge pull request #113 from DeterminateSystems/update-detsys-ts-status-page
Update detsys-ts (status page changes)
2024-06-03 09:18:41 -07:00
Luc Perkins
aecc58b9ac
Update detsys-ts (status page changes) 2024-06-03 09:12:51 -07:00
Graham Christensen
41c8f7e1b5
Merge pull request #112 from DeterminateSystems/srv
Update detsys-ts for srv
2024-05-31 12:05:22 -04:00
Graham Christensen
be77a56766 eslint stricter 2024-05-31 11:40:33 -04:00
Graham Christensen
d98ea6576b Update detsys-ts for srv 2024-05-31 11:34:46 -04:00
Luc Perkins
2b0d863d87
Merge pull request #111 from DeterminateSystems/update-detsys-ts
Update detsys-ts
2024-05-29 15:20:23 -03:00
Luc Perkins
559c3e249c
Update detsys-ts 2024-05-29 15:18:32 -03:00
Luc Perkins
222f041780
Merge pull request #108 from DeterminateSystems/strict-mode-env-var
Add environment variable for strict mode input
2024-05-23 12:26:35 -03:00
Luc Perkins
0e2a61b1f3
Add environment variable for strict mode input 2024-05-23 12:23:56 -03:00
Luc Perkins
ede634b2c8
Merge pull request #107 from DeterminateSystems/strict-mode-not-required
Make strict mode input not required
2024-05-23 12:05:47 -03:00
Luc Perkins
7a7f13f9b5
Make strict mode input not required 2024-05-23 12:03:54 -03:00
Luc Perkins
e0fe1f8e46
Merge pull request #105 from DeterminateSystems/detsys-ts-update
Update detsys-ts
2024-05-22 20:27:21 -03:00
Luc Perkins
7ce3b51a1d
Update detsys-ts 2024-05-22 15:40:01 -03:00
Graham Christensen
4f21d96ab3
Merge pull request #103 from DeterminateSystems/space-sep
Split flake inputs on spaces instead of commas
2024-05-09 18:14:58 -04:00
Graham Christensen
165ae6e270 space-sep'd inputs 2024-05-09 18:13:24 -04:00
Graham Christensen
bcabaab2f1
Merge pull request #101 from DeterminateSystems/detsys-ts
Convert the Action into TypeScript
2024-05-09 15:50:34 -04:00
Graham Christensen
406a429015 Regenerate 2024-05-09 15:48:13 -04:00
Graham Christensen
28eac596e7 nits on the nits 2024-05-09 15:47:03 -04:00
Graham Christensen
da64c8c904 nits 2024-05-09 15:45:38 -04:00
Graham Christensen
3fa85bcf4c nit: run line 2024-05-09 15:44:43 -04:00
Graham Christensen
d021735a89 space separated options 2024-05-09 15:35:58 -04:00
Graham Christensen
d978837d43 Expose all inputs 2024-05-09 15:35:53 -04:00
Graham Christensen
fc5dacd10b Use nix flake update if no inputs are specified 2024-05-09 14:15:38 -04:00
Graham Christensen
7352b7f36b lockfile-summary, d'oh 2024-05-07 23:03:21 -04:00
Graham Christensen
6d82bce8ec Update detsys-ts 2024-05-07 23:03:12 -04:00
Graham Christensen
8363f28293 Call the node action instead directly 2024-05-07 23:02:56 -04:00
Graham Christensen
1752965d0b Don't cd separately 2024-05-06 16:13:34 -04:00
Luc Perkins
21663d562d
Rename workflow 2024-04-29 10:15:25 -03:00
Luc Perkins
6318aa12c1
Remove now-unnecessary shellcheck check 2024-04-26 14:23:24 -03:00
Luc Perkins
239b4c9810
Add JS-specific bits to Actions 2024-04-26 14:19:53 -03:00
Luc Perkins
539b7a6481
Remove Bash script and do more TS streamlining 2024-04-26 12:10:07 -03:00
Luc Perkins
dde5487502
Finish initial rework into TS 2024-04-26 11:55:19 -03:00
Luc Perkins
502daa7e5e
Construct Nix command 2024-04-21 19:50:32 -03:00
Luc Perkins
b1f8684b21
Update Nix shell and add envrc 2024-04-21 19:42:23 -03:00
Luc Perkins
cf6776dfd1
Add initial JS setup 2024-04-21 19:17:03 -03:00
Ian Cleary
cc5f064749 Update README.md to use actions/checkout@v4 2024-04-08 09:21:10 -07:00
Cole Helbling
a3ccb8f597 Update pedrolamas/handlebars-action to 2.4.0 2024-02-29 07:07:00 -08:00
Cole Helbling
56b3507bfe Update DamianReeves/write-file-action to v1.3 2024-02-28 15:06:00 -08:00
dependabot[bot]
70d01ca550 build(deps): bump pedrolamas/handlebars-action from 2.2.0 to 2.3.0
Bumps [pedrolamas/handlebars-action](https://github.com/pedrolamas/handlebars-action) from 2.2.0 to 2.3.0.
- [Release notes](https://github.com/pedrolamas/handlebars-action/releases)
- [Commits](https://github.com/pedrolamas/handlebars-action/compare/v2.2.0...v2.3.0)

---
updated-dependencies:
- dependency-name: pedrolamas/handlebars-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-28 14:55:32 -08:00
dependabot[bot]
96c74d26ed build(deps): bump actions/checkout from 2 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-28 14:55:13 -08:00
dependabot[bot]
0631a12d9a build(deps): bump crazy-max/ghaction-import-gpg from 5 to 6
Bumps [crazy-max/ghaction-import-gpg](https://github.com/crazy-max/ghaction-import-gpg) from 5 to 6.
- [Release notes](https://github.com/crazy-max/ghaction-import-gpg/releases)
- [Commits](https://github.com/crazy-max/ghaction-import-gpg/compare/v5...v6)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-import-gpg
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-28 14:54:51 -08:00
Morgan Helton
a72d3c5880 update peter-evans/create-pull-request to v6 2024-02-28 14:54:06 -08:00
Pol Dellaiera
e98d4358e3 Bump peter-evans/create-pull-request to v5 2023-10-10 13:22:51 -07:00
Graham Christensen
d374cc7d4a Mechanical migration to FlakeHub 2023-10-10 13:21:55 -07:00
Graham Christensen
af80b95b83
Update action versions to main.
Folks can pin to recent versions if they choose.
2023-09-15 21:58:32 -04:00
Graham Christensen
da2fd6f256
Update action.yml 2023-08-24 00:12:15 -04:00
Ana Hobden
fd510d25c0
Merge pull request #78 from DeterminateSystems/DS-970
DS-970: Add Magic Nix Cache and other workflow changes
2023-07-21 09:21:51 -07:00
Martin Wimpress
1a057b79b1
ci: clearly name steps in update.yml 2023-07-21 15:52:27 +01:00
Martin Wimpress
51e1459968
DS-970: Add Magic Nix Cache and other workflow changes
An assortment of GitHub Workflow changes, potentially including:

- Enable DeterminateSystems/magic-nix-cache-action@main
- Reference all DeterminateSystems actions via @main
- Make update.yaml consistent across repos
- Remove unnecessary github-token: from nix-installer-action
- Update actions/checkout@v2 to actions/checkout@v3
2023-07-14 10:21:02 +01:00
Carl Thomé
4fbf969957 actions/checkout@v2 -> actions/checkout@v3 2023-06-29 06:13:10 -07:00
Carl Thomé
55ddfbef62 Bump actions/checkout in example 2023-06-29 06:13:10 -07:00
xgroleau🐢
dec3bc3c9b fix: removed commented commit escaping code 2023-03-29 11:11:22 -07:00
xgroleau🐢
ad81b423ab fix: use multiline string 2023-03-29 11:11:22 -07:00
xgroleau🐢
c7487e8c98 doc: doc a bit more specific on the options format 2023-03-29 11:11:22 -07:00
xgroleau🐢
54eb0b2901 doc: Info in readme 2023-03-29 11:11:22 -07:00
xgroleau🐢
8a88a06550 fix: pr message fix 2023-03-29 11:11:22 -07:00
xgroleau🐢
9af2d0f36a fix : replace action using deprecated node 12 2023-03-29 11:11:22 -07:00
xgroleau🐢
b55ee105d9 feat: Added nix option
fix: nix options position

Use empty list


fix options
2023-03-29 11:11:22 -07:00
Budiman Jojo
bc75a5b55e expose status of PR 2023-03-27 09:17:55 -07:00
Jörg Thalheim
786e5cf5a2 allow to set base branch of pull request 2023-03-27 08:43:21 -07:00
25 changed files with 94311 additions and 206 deletions

View file

@ -1,15 +1,10 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
# https://editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
[*.{yml,yaml}]
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

74
.eslintrc.json Normal file
View file

@ -0,0 +1,74 @@
{
"plugins": ["@typescript-eslint"],
"extends": ["plugin:github/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"settings": {
"import/resolver": {
"typescript": {}
}
},
"rules": {
"i18n-text/no-en": "off",
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
],
"@typescript-eslint/explicit-member-accessibility": [
"error",
{
"accessibility": "no-public"
}
],
"@typescript-eslint/no-base-to-string": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "error",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
},
"env": {
"node": true,
"es6": true
}
}

View file

@ -1,17 +1,40 @@
name: CI
on:
pull_request:
push:
branches: [main]
jobs:
shellcheck:
runs-on: ubuntu-latest
typescript-action:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Nix
- name: Check Nixpkgs
uses: DeterminateSystems/flake-checker-action@main
with:
fail-mode: true
- name: Install Determinate Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Shellcheck
run: nix-shell --run 'shellcheck $(find . -type f -name "*.sh" -executable)'
with:
determinate: true
- name: Enable FlakeHub Cache
uses: DeterminateSystems/flakehub-cache-action@main
- name: Install pnpm dependencies
run: nix develop --command pnpm install
- name: Check formatting
run: nix develop --command pnpm run check-fmt
- name: Lint
run: nix develop --command pnpm run lint
- name: Build
run: nix develop --command pnpm run build
- name: Run test suite
run: nix develop --command pnpm run test
- name: Package
run: nix develop --command pnpm run package
- name: Check git status
run: git status --porcelain=v1
- name: Ensure no staged changes
run: git diff --exit-code

View file

@ -1,4 +1,5 @@
name: update-flake-lock
on:
workflow_dispatch:
schedule:
@ -6,11 +7,17 @@ on:
jobs:
lockfile:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Nix
- name: Checkout
uses: actions/checkout@v4
- name: Install Determinate Nix
uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- name: Enable FlakeHub Cache
uses: DeterminateSystems/flakehub-cache-action@main
- name: Update flake.lock
uses: ./.
with:
_internal-strict-mode: true

View file

@ -1,4 +1,5 @@
name: CI
on:
pull_request:
push:
@ -6,9 +7,9 @@ on:
jobs:
validate:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate YAML

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# JS dependencies
node_modules/

5
.prettierignore Normal file
View file

@ -0,0 +1,5 @@
dist/
lib/
node_modules/
pnpm-lock.yaml
README.md

198
README.md
View file

@ -1,15 +1,18 @@
# update-flake-lock
This is a GitHub Action that will update your flake.lock file whenever it is run.
This is a GitHub Action that updates the [`flake.lock`][lockfile] file for your [Nix flake][flakes] whenever it is run.
> **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.
> [!NOTE]
> As of v3, this action no longer automatically installs [Determinate Nix][det-nix] to the action runner.
> You **must** set up Nix with flakes support enabled prior to running this action or your workflow will not function as expected.
## Example
An example GitHub Action workflow using this action would look like the following:
Here's an example GitHub Action workflow using this Action:
```yaml
name: update-flake-lock
on:
workflow_dispatch: # allows manual triggering
schedule:
@ -20,11 +23,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v1
uses: actions/checkout@v4
- name: Install Determinate Nix
uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@vX
uses: DeterminateSystems/update-flake-lock@main
with:
pr-title: "Update flake.lock" # Title of PR to be created
pr-labels: | # Labels to be set on the PR
@ -34,9 +39,38 @@ jobs:
## Example updating specific input(s)
> **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.
> [!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 are also updated. At this time, there is no known workaround.
It is also possible to update specific inputs by specifying them in a space-separated list:
It's also possible to update specific [flake inputs][inputs] by specifying them in a space-separated list:
```yaml
name: update-flake-lock
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
jobs:
lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Determinate Nix
uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
with:
inputs: input1 input2 input3
```
## Example adding options to nix command
It's also possible to use specific options to the `nix` command in a space-separated list:
```yaml
name: update-flake-lock
@ -50,13 +84,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v1
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@vX
uses: actions/checkout@v4
- name: Install Determinate Nix
uses: DeterminateSystems/nix-installer-action@main
with:
inputs: input1 input2 input3
determinate: true
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
with:
nix-options: --debug --log-format raw
```
## Example that prints the number of the created PR
@ -73,12 +109,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v1
uses: actions/checkout@v4
- name: Install Determinate Nix
uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- name: Update flake.lock
id: update
uses: DeterminateSystems/update-flake-lock@vX
uses: DeterminateSystems/update-flake-lock@main
with:
inputs: input1 input2 input3
- name: Print PR number
@ -102,12 +140,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v1
uses: actions/checkout@v4
- name: Install Determinate Nix
uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- name: Update flake.lock
if: ${{ github.event_name != 'pull_request' }}
uses: DeterminateSystems/update-flake-lock@vX
uses: DeterminateSystems/update-flake-lock@main
with:
inputs: input1 input2 input3
path-to-flake-dir: 'nix/' # in this example our flake doesn't sit at the root of the repository, it sits under 'nix/flake.nix'
@ -129,38 +169,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v1
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@vX
uses: actions/checkout@v4
- name: Install Determinate Nix
uses: DeterminateSystems/nix-installer-action@main
with:
git-author-name: 'Jane Author'
git-author-email: 'github-actions[bot]@users.noreply.github.com'
git-committer-name: 'John Committer'
git-committer-email: 'github-actions[bot]@users.noreply.github.com'
determinate: true
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
with:
git-author-name: Jane Author
git-author-email: github-actions[bot]@users.noreply.github.com
git-committer-name: John Committer
git-committer-email: github-actions[bot]@users.noreply.github.com
```
## Running GitHub Actions CI
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.
GitHub Actions doesn't 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.
### Without a Personal Authentication Token
Without using a Personal Authentication Token, you can manually run the following to kick off a CI run:
```
git branch -D update_flake_lock_action
git fetch origin
git checkout update_flake_lock_action
git commit --amend --no-edit
git push origin update_flake_lock_action --force
```
Without using a Personal Authentication Token, close and reopen the pull request manually to kick off CI.
### With a Personal Authentication Token
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).
You can create a token by visiting https://github.com/settings/tokens and select at least the `repo` scope. 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:
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).
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:
```yaml
name: update-flake-lock
@ -174,31 +209,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v1
uses: actions/checkout@v4
- name: Install Determinate Nix
uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@vX
uses: DeterminateSystems/update-flake-lock@main
with:
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
```
## With GPG commit signing
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.
It's possible for the bot to produce GPG-signed commits.
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.
This can be a compliance requirement in some cases.
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.
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).
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.
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).
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).
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.
If you want to sign using a subkey, you must specify the subkey fingerprint using the `gpg-fingerprint` input parameter.
You can find an example of how to using this action with commit signing below:
Here's an example of how to using this action with commit signing:
```yaml
name: update-flake-lock
on:
workflow_dispatch: # allows manual triggering
schedule:
@ -209,11 +250,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v1
uses: actions/checkout@v4
- name: Install Determinate Nix
uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@vX
uses: DeterminateSystems/update-flake-lock@main
with:
sign-commits: true
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
@ -223,18 +266,19 @@ jobs:
## Custom PR Body
By default the generated PR body is set to be the following template:
By default, the generated PR body uses this template:
````handlebars
Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action.
```
````
{{ env.GIT_COMMIT_MESSAGE }}
````
```
### Running GitHub Actions on this PR
GitHub Actions will not run workflows on pull requests which are opened by a GitHub Action.
GitHub Actions doesn't run workflows on pull requests that are opened by a GitHub Action.
To run GitHub Actions workflows on this PR, run:
@ -247,12 +291,14 @@ git push origin update_flake_lock_action --force
```
````
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:
- env.GIT_AUTHOR_NAME
- env.GIT_AUTHOR_EMAIL
- env.GIT_COMMITTER_NAME
- env.GIT_COMMITTER_EMAIL
- env.GIT_COMMIT_MESSAGE
You can customize it, however, using variable interpolation performed with [Handlebars].
This enables you to customize the template with these variables:
- `env.GIT_AUTHOR_NAME`
- `env.GIT_AUTHOR_EMAIL`
- `env.GIT_COMMITTER_NAME`
- `env.GIT_COMMITTER_EMAIL`
- `env.GIT_COMMIT_MESSAGE`
## Add assignees or reviewers
@ -271,11 +317,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v1
uses: actions/checkout@v4
- name: Install Determinate Nix
uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@vX
uses: DeterminateSystems/update-flake-lock@main
with:
pr-assignees: SomeGitHubUsername
pr-reviewers: SomeOtherGitHubUsername,SomeThirdGitHubUsername
@ -283,8 +331,16 @@ jobs:
## Contributing
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.
Feel free to send a PR or open an issue if you find that something functions unexpectedly!
Please make sure to test your changes and update any related documentation before submitting your PR.
### How to test changes
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.
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.
[det-nix]: https://docs.determinate.systems/determinate-nix
[flakes]: https://zero-to-nix.com/concepts/flakes
[handlebars]: https://handlebarsjs.com
[inputs]: https://zero-to-nix.com/concepts/flakes/#inputs
[lockfile]: https://zero-to-nix.com/concepts/flakes/#lockfile

View file

@ -1,32 +1,34 @@
name: 'Update flake.lock'
description: 'Update your flake.lock and send a PR'
name: "Update Nix Flake Lock"
description: "Update your Nix flake.lock and send a PR"
inputs:
inputs:
description: 'A space-separated list of inputs to update. Leave empty to update all inputs.'
description: "A space-separated list of inputs to update. Leave empty to update all inputs."
required: false
default: ''
default: ""
token:
description: 'GITHUB_TOKEN or a `repo` scoped Personal Access Token (PAT)'
description: "GITHUB_TOKEN or a `repo` scoped Personal Access Token (PAT)"
required: false
default: ${{ github.token }}
commit-msg:
description: 'The message provided with the commit'
description: "The message provided with the commit"
required: false
default: "flake.lock: Update"
base:
description: "Sets the pull request base branch. Defaults to the branch checked out in the workflow."
required: false
branch:
description: 'The branch of the PR to be created'
description: "The branch of the PR to be created"
required: false
default: "update_flake_lock_action"
path-to-flake-dir:
description: 'The path of the directory containing `flake.nix` file within your repository. Useful when `flake.nix` cannot reside at the root of your repository.'
description: "The path of the directory containing `flake.nix` file within your repository. Useful when `flake.nix` cannot reside at the root of your repository."
required: false
default: ''
pr-title:
description: 'The title of the PR to be created'
description: "The title of the PR to be created"
required: false
default: "flake.lock: Update"
pr-body:
description: 'The body of the PR to be created'
description: "The body of the PR to be created"
required: false
default: |
Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action.
@ -39,73 +41,79 @@ inputs:
GitHub Actions will not run workflows on pull requests which are opened by a GitHub Action.
To run GitHub Actions workflows on this PR, run:
```sh
git branch -D update_flake_lock_action
git fetch origin
git checkout update_flake_lock_action
git commit --amend --no-edit
git push origin update_flake_lock_action --force
```
**To run GitHub Actions workflows on this PR, close and re-open this pull request.**
pr-labels:
description: 'A comma or newline separated list of labels to set on the Pull Request to be created'
description: "A comma or newline separated list of labels to set on the Pull Request to be created"
required: false
default: ''
default: ""
pr-assignees:
description: 'A comma or newline separated list of assignees (GitHub usernames).'
description: "A comma or newline separated list of assignees (GitHub usernames)."
required: false
default: ''
default: ""
pr-reviewers:
description: 'A comma or newline separated list of reviewers (GitHub usernames) to request a review from.'
description: "A comma or newline separated list of reviewers (GitHub usernames) to request a review from."
required: false
default: ''
default: ""
git-author-name:
description: 'Author name used for commit. Only used if sign-commits is false.'
description: "Author name used for commit. Only used if sign-commits is false."
required: false
default: 'github-actions[bot]'
default: "github-actions[bot]"
git-author-email:
description: 'Author email used for commit. Only used if sign-commits is false.'
description: "Author email used for commit. Only used if sign-commits is false."
required: false
default: 'github-actions[bot]@users.noreply.github.com'
default: "github-actions[bot]@users.noreply.github.com"
git-committer-name:
description: 'Committer name used for commit. Only used if sign-commits is false.'
description: "Committer name used for commit. Only used if sign-commits is false."
required: false
default: 'github-actions[bot]'
default: "github-actions[bot]"
git-committer-email:
description: 'Committer email used for commit. Only used if sign-commits is false.'
description: "Committer email used for commit. Only used if sign-commits is false."
required: false
default: 'github-actions[bot]@users.noreply.github.com'
default: "github-actions[bot]@users.noreply.github.com"
sign-commits:
description: 'Set to true if the action should sign the commit with GPG'
description: "Set to true if the action should sign the commit with GPG"
required: false
default: 'false'
default: "false"
gpg-private-key:
description: 'GPG Private Key with which to sign the commits in the PR to be created'
description: "GPG Private Key with which to sign the commits in the PR to be created"
required: false
default: ''
default: ""
gpg-fingerprint:
description: 'Fingerprint of specific GPG subkey to use'
description: "Fingerprint of specific GPG subkey to use"
required: false
gpg-passphrase:
description: 'GPG Private Key Passphrase for the GPG Private Key with which to sign the commits in the PR to be created'
description: "GPG Private Key Passphrase for the GPG Private Key with which to sign the commits in the PR to be created"
required: false
default: ''
default: ""
nix-options:
description: "A space-separated list of options to pass to the nix command"
required: false
default: ""
_internal-strict-mode:
description: Whether to fail when any errors are thrown. Used only to test the Action; do not set this in your own workflows.
required: false
default: false
outputs:
pull-request-number:
description: 'The number of the opened pull request'
description: "The number of the opened pull request"
value: ${{ steps.create-pr.outputs.pull-request-number }}
pull-request-url:
description: "The The URL of the opened pull request."
value: ${{ steps.create-pr.outputs.pull-request-url }}
pull-request-operation:
description: "The pull request operation performed by the action, `created`, `updated` or `closed`."
value: ${{ steps.create-pr.outputs.pull-request-operation }}
runs:
using: "composite"
steps:
- name: Import bot's GPG key for signing commits
if: ${{ inputs.sign-commits == 'true' }}
id: import-gpg
uses: crazy-max/ghaction-import-gpg@v5
uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6.3.0
with:
gpg_private_key: ${{ inputs.gpg-private-key }}
fingerprint: ${{ inputs.gpg-fingerprint }}
fingerprint: ${{ inputs.gpg-fingerprint }}
passphrase: ${{ inputs.gpg-passphrase }}
git_config_global: true
git_user_signingkey: true
@ -132,19 +140,37 @@ runs:
echo "GIT_AUTHOR_EMAIL=<${{ inputs.git-author-email }}>" >> $GITHUB_ENV
echo "GIT_COMMITTER_NAME=${{ inputs.git-committer-name }}" >> $GITHUB_ENV
echo "GIT_COMMITTER_EMAIL=<${{ inputs.git-committer-email }}>" >> $GITHUB_ENV
- name: Run update-flake-lock.sh
run: $GITHUB_ACTION_PATH/update-flake-lock.sh
- name: Run update-flake-lock
shell: bash
run: node "$GITHUB_ACTION_PATH/dist/index.js"
env:
GIT_AUTHOR_NAME: ${{ env.GIT_AUTHOR_NAME }}
GIT_AUTHOR_EMAIL: ${{ env.GIT_AUTHOR_EMAIL }}
GIT_COMMITTER_NAME: ${{ env.GIT_COMMITTER_NAME }}
GIT_COMMITTER_EMAIL: ${{ env.GIT_COMMITTER_EMAIL }}
TARGETS: ${{ inputs.inputs }}
COMMIT_MSG: ${{ inputs.commit-msg }}
PATH_TO_FLAKE_DIR: ${{ inputs.path-to-flake-dir }}
# The following manually exposes all of the action inputs into INPUT_ environment variables so actionsCore.getInput works:
# https://github.com/actions/toolkit/blob/ae38557bb0dba824cdda26ce787bd6b66cf07a83/packages/core/src/core.ts#L126
INPUT_BASE: ${{ inputs.base }}
INPUT_BRANCH: ${{ inputs.branch }}
INPUT_COMMIT-MSG: ${{ inputs.commit-msg }}
INPUT_GIT-AUTHOR-EMAIL: ${{ inputs.git-author-email }}
INPUT_GIT-AUTHOR-NAME: ${{ inputs.git-author-name }}
INPUT_GIT-COMMITTER-EMAIL: ${{ inputs.git-committer-email }}
INPUT_GIT-COMMITTER-NAME: ${{ inputs.git-committer-name }}
INPUT_GPG-FINGERPRINT: ${{ inputs.gpg-fingerprint }}
INPUT_GPG-PASSPHRASE: ${{ inputs.gpg-passphrase }}
INPUT_GPG-PRIVATE-KEY: ${{ inputs.gpg-private-key }}
INPUT_INPUTS: ${{ inputs.inputs }}
INPUT_NIX-OPTIONS: ${{ inputs.nix-options }}
INPUT_PATH-TO-FLAKE-DIR: ${{ inputs.path-to-flake-dir }}
INPUT_PR-ASSIGNEES: ${{ inputs.pr-assignees }}
INPUT_PR-BODY: ${{ inputs.pr-body }}
INPUT_PR-LABELS: ${{ inputs.pr-labels }}
INPUT_PR-REVIEWERS: ${{ inputs.pr-reviewers }}
INPUT_PR-TITLE: ${{ inputs.pr-title }}
INPUT_PULL-REQUEST-NUMBER: ${{ inputs.pull-request-number }}
INPUT_PULL-REQUEST-OPERATION: ${{ inputs.pull-request-operation }}
INPUT_SIGN-COMMITS: ${{ inputs.sign-commits }}
INPUT_TOKEN: ${{ inputs.token }}
INPUT__INTERNAL-STRICT-MODE: ${{ inputs._internal-strict-mode }}
- name: Save PR Body as file
uses: DamianReeves/write-file-action@v1.2
uses: DamianReeves/write-file-action@v1.3
with:
path: pr_body.template
contents: ${{ inputs.pr-body }}
@ -152,20 +178,20 @@ runs:
- name: Set additional env variables (GIT_COMMIT_MESSAGE)
shell: bash
run: |
GIT_COMMIT_MESSAGE="$(git log --format=%b -n 1)"
GIT_COMMIT_MESSAGE="${GIT_COMMIT_MESSAGE//'%'/'%25'}"
GIT_COMMIT_MESSAGE="${GIT_COMMIT_MESSAGE//$'\n'/'%0A'}"
GIT_COMMIT_MESSAGE="${GIT_COMMIT_MESSAGE//$'\r'/'%0D'}"
echo "GIT_COMMIT_MESSAGE=$GIT_COMMIT_MESSAGE" >> $GITHUB_ENV
echo "GIT_COMMIT_MESSAGE is: ${GIT_COMMIT_MESSAGE}"
DELIMITER=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
COMMIT_MESSAGE="$(git log --format=%b -n 1)"
echo "GIT_COMMIT_MESSAGE<<$DELIMITER" >> $GITHUB_ENV
echo "$COMMIT_MESSAGE" >> $GITHUB_ENV
echo "$DELIMITER" >> $GITHUB_ENV
echo "GIT_COMMIT_MESSAGE is: ${COMMIT_MESSAGE}"
- name: Interpolate PR Body
uses: pedrolamas/handlebars-action@v2.2.0
uses: pedrolamas/handlebars-action@2995d7eadacbc8f2f6ab8431a01d84a5fa3b8bb4 # v2.4.0
with:
files: 'pr_body.template'
output-filename: 'pr_body.txt'
files: "pr_body.template"
output-filename: "pr_body.txt"
- name: Read pr_body.txt
id: pr_body
uses: andstor/file-reader-action@v1
uses: juliangruber/read-file-action@v1
with:
path: "pr_body.txt"
# We need to remove the pr_body files so that the
@ -176,8 +202,9 @@ runs:
run: rm -f pr_body.txt pr_body.template
- name: Create PR
id: create-pr
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
with:
base: ${{ inputs.base }}
branch: ${{ inputs.branch }}
delete-branch: true
committer: ${{ env.GIT_COMMITTER_NAME }} ${{ env.GIT_COMMITTER_EMAIL }}
@ -187,4 +214,4 @@ runs:
assignees: ${{ inputs.pr-assignees }}
labels: ${{ inputs.pr-labels }}
reviewers: ${{ inputs.pr-reviewers }}
body: ${{ steps.pr_body.outputs.contents }}
body: ${{ steps.pr_body.outputs.content }}

2
dist/index.d.ts vendored Normal file
View file

@ -0,0 +1,2 @@
export { }

88703
dist/index.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/index.js.map vendored Normal file

File diff suppressed because one or more lines are too long

3
dist/package.json vendored Normal file
View file

@ -0,0 +1,3 @@
{
"type": "module"
}

View file

@ -2,18 +2,16 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1659131907,
"narHash": "sha256-8bz4k18M/FuVC+EVcI4aREN2PsEKT7LGmU2orfjnpCg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8d435fca5c561da8168abb30270788d2da2a7951",
"type": "github"
"lastModified": 1744232761,
"narHash": "sha256-gbl9hE39nQRpZaLjhWKmEu5ejtQsgI5TWYrIVVJn30U=",
"rev": "f675531bc7e6657c10a18b565cfebd8aa9e24c14",
"revCount": 781462,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.781462%2Brev-f675531bc7e6657c10a18b565cfebd8aa9e24c14/019624ad-56cd-7f8b-93ed-52e57165b6b6/source.tar.gz"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
"type": "tarball",
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz"
}
},
"root": {

View file

@ -1,30 +1,23 @@
{
description = "update-flake-lock";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
outputs =
{ self
, nixpkgs
}:
outputs = { self, nixpkgs }:
let
nameValuePair = name: value: { inherit name value; };
genAttrs = names: f: builtins.listToAttrs (map (n: nameValuePair n (f n)) names);
allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forAllSystems = f: genAttrs allSystems
(system: f {
inherit system;
pkgs = import nixpkgs { inherit system; };
});
supportedSystems = [ "x86_64-linux" "aarch64-darwin" "aarch64-linux" "x86_64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
devShell = forAllSystems
({ system, pkgs, ... }:
pkgs.stdenv.mkDerivation {
name = "update-flake-lock-devshell";
buildInputs = [ pkgs.shellcheck ];
src = self;
});
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
nodejs_latest
nodePackages_latest.pnpm
];
};
});
};
}

47
package.json Normal file
View file

@ -0,0 +1,47 @@
{
"name": "update-flake-lock",
"version": "1.0.0",
"description": "",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"scripts": {
"build": "tsup",
"format": "prettier --write .",
"check-fmt": "prettier --check .",
"lint": "eslint src/**/*.ts --ignore-pattern *.test.ts",
"package": "ncc build",
"test": "vitest --watch false",
"all": "pnpm run format && pnpm run lint && pnpm run build && pnpm run package"
},
"repository": {
"type": "git",
"url": "git+https://github.com/DeterminateSystems/update-flake-lock.git"
},
"keywords": [],
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/DeterminateSystems/update-flake-lock/issues"
},
"homepage": "https://github.com/DeterminateSystems/update-flake-lock#readme",
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/exec": "^1.1.1",
"detsys-ts": "github:DeterminateSystems/detsys-ts"
},
"devDependencies": {
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@vercel/ncc": "^0.38.3",
"eslint": "^8.57.1",
"eslint-import-resolver-typescript": "^3.10.0",
"eslint-plugin-github": "^4.10.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.6",
"prettier": "^3.5.3",
"tsup": "^8.4.0",
"typescript": "^5.8.3",
"vitest": "^3.1.1"
}
}

4956
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load diff

12
prettier.config.cjs Normal file
View file

@ -0,0 +1,12 @@
/** @type {import('prettier').Config} */
module.exports = {
plugins: [require.resolve("@trivago/prettier-plugin-sort-imports")],
semi: true,
singleQuote: false,
tabWidth: 2,
trailingComma: "all",
useTabs: false,
// Import sorting
importOrderSeparation: true,
importOrderSortSpecifiers: true,
};

76
src/index.ts Normal file
View file

@ -0,0 +1,76 @@
import { makeNixCommandArgs } from "./nix.js";
import * as actionsCore from "@actions/core";
import * as actionsExec from "@actions/exec";
import { DetSysAction, inputs } from "detsys-ts";
const EVENT_EXECUTION_FAILURE = "execution_failure";
class UpdateFlakeLockAction extends DetSysAction {
private commitMessage: string;
private nixOptions: string[];
private flakeInputs: string[];
private pathToFlakeDir: string | null;
constructor() {
super({
name: "update-flake-lock",
fetchStyle: "universal",
requireNix: "fail",
});
this.commitMessage = inputs.getString("commit-msg");
this.flakeInputs = inputs.getArrayOfStrings("inputs", "space");
this.nixOptions = inputs.getArrayOfStrings("nix-options", "space");
this.pathToFlakeDir = inputs.getStringOrNull("path-to-flake-dir");
}
async main(): Promise<void> {
await this.update();
}
// No post phase
async post(): Promise<void> {}
async update(): Promise<void> {
// Nix command of this form:
// nix ${maybe nix options} flake ${"update" or "lock"} ${maybe --update-input flags} --commit-lock-file --commit-lockfile-summary ${commit message}
// Example commands:
// nix --extra-substituters https://example.com flake lock --update-input nixpkgs --commit-lock-file --commit-lockfile-summary "updated flake.lock"
// nix flake update --commit-lock-file --commit-lockfile-summary "updated flake.lock"
const nixCommandArgs: string[] = makeNixCommandArgs(
this.nixOptions,
this.flakeInputs,
this.commitMessage,
);
actionsCore.debug(
JSON.stringify({
options: this.nixOptions,
inputs: this.flakeInputs,
message: this.commitMessage,
args: nixCommandArgs,
}),
);
const execOptions: actionsExec.ExecOptions = {
cwd: this.pathToFlakeDir !== null ? this.pathToFlakeDir : undefined,
};
const exitCode = await actionsExec.exec("nix", nixCommandArgs, execOptions);
if (exitCode !== 0) {
this.recordEvent(EVENT_EXECUTION_FAILURE, {
exitCode,
});
actionsCore.setFailed(`non-zero exit code of ${exitCode} detected`);
} else {
actionsCore.info(`flake.lock file was successfully updated`);
}
}
}
function main(): void {
new UpdateFlakeLockAction().execute();
}
main();

77
src/nix.test.ts Normal file
View file

@ -0,0 +1,77 @@
import { makeNixCommandArgs } from "./nix.js";
import { expect, test } from "vitest";
type TestCase = {
inputs: {
nixOptions: string[];
flakeInputs: string[];
commitMessage: string;
};
expected: string[];
};
test("Nix command arguments", () => {
const testCases: TestCase[] = [
{
inputs: {
nixOptions: ["--log-format", "raw"],
flakeInputs: [],
commitMessage: "just testing",
},
expected: [
"--log-format",
"raw",
"flake",
"update",
"--commit-lock-file",
"--option",
"commit-lockfile-summary",
"just testing",
],
},
{
inputs: {
nixOptions: [],
flakeInputs: ["nixpkgs", "rust-overlay"],
commitMessage: "just testing",
},
expected: [
"flake",
"lock",
"--update-input",
"nixpkgs",
"--update-input",
"rust-overlay",
"--commit-lock-file",
"--option",
"commit-lockfile-summary",
"just testing",
],
},
{
inputs: {
nixOptions: ["--debug"],
flakeInputs: [],
commitMessage: "just testing",
},
expected: [
"--debug",
"flake",
"update",
"--commit-lock-file",
"--option",
"commit-lockfile-summary",
"just testing",
],
},
];
testCases.forEach(({ inputs, expected }) => {
const args = makeNixCommandArgs(
inputs.nixOptions,
inputs.flakeInputs,
inputs.commitMessage,
);
expect(args).toStrictEqual(expected);
});
});

31
src/nix.ts Normal file
View file

@ -0,0 +1,31 @@
// Build the Nix args out of inputs from the Actions environment
export function makeNixCommandArgs(
nixOptions: string[],
flakeInputs: string[],
commitMessage: string,
): string[] {
const flakeInputFlags = flakeInputs.flatMap((input) => [
"--update-input",
input,
]);
// NOTE(cole-h): In Nix versions 2.23.0 and later, `commit-lockfile-summary` became an alias to
// the setting `commit-lock-file-summary` (https://github.com/NixOS/nix/pull/10691), and Nix does
// not treat aliases the same as their "real" setting by requiring setting aliases to be
// configured via `--option <alias name> <option value>`
// (https://github.com/NixOS/nix/issues/10989).
// So, we go the long way so that we can support versions both before and after Nix 2.23.0.
const lockfileSummaryFlags = [
"--option",
"commit-lockfile-summary",
commitMessage,
];
const updateLockMechanism = flakeInputFlags.length === 0 ? "update" : "lock";
return nixOptions
.concat(["flake", updateLockMechanism])
.concat(flakeInputFlags)
.concat(["--commit-lock-file"])
.concat(lockfileSummaryFlags);
}

15
tsconfig.json Normal file
View file

@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
"module": "Node16",
"moduleResolution": "NodeNext",
"outDir": "./dist",
"rootDir": "./src",
"strict": true /* Enable all strict type-checking options. */,
"noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
"resolveJsonModule": true,
"declaration": true
},
"exclude": ["node_modules", "**/*.test.ts", "dist"]
}

16
tsup.config.ts Normal file
View file

@ -0,0 +1,16 @@
import { name } from "./package.json";
import { defineConfig } from "tsup";
export default defineConfig({
name,
entry: ["src/index.ts"],
format: ["esm"],
target: "node20",
bundle: true,
splitting: false,
sourcemap: true,
clean: true,
dts: {
resolve: true,
},
});

View file

@ -1,16 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ -n "$PATH_TO_FLAKE_DIR" ]]; then
cd "$PATH_TO_FLAKE_DIR"
fi
if [[ -n "$TARGETS" ]]; then
inputs=()
for input in $TARGETS; do
inputs+=("--update-input" "$input")
done
nix flake lock "${inputs[@]}" --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
else
nix flake update --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
fi