-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.67 KB
/
sync-toolchain-versions.yml
File metadata and controls
40 lines (38 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Sync Toolchain Versions
on:
pull_request:
paths:
- .github/workflows/sync-toolchain.yml
- flake.lock
jobs:
sync-toolchain-versions:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: cachix/install-nix-action@ab739621df7a23f52766f9ccc97f38da6b7af14f # v31
- name: Get the Node.js version and update .node-version and renovate.json
run: |
NODE_VERSION=$(nix develop --command node --version)
echo "${NODE_VERSION:1}" > .node-version
jq "(.packageRules[]
| select(.matchPackageNames and (.matchPackageNames | contains([\"@types/node\"])))
| .allowedVersions) = \"<=${NODE_VERSION:1}\"" \
renovate.json > tmp.json
mv tmp.json renovate.json
- name: Get the Bun version and update .bun-version
run: |
BUN_VERSION=$(nix develop --command bun --version)
echo "$BUN_VERSION" > .bun-version
- name: Update `wrangler.json` "compatibility_date"
run: |
CURRENT_DATE=$(date +%Y-%m-%d)
jq ".compatibility_date = \"$CURRENT_DATE\"" wrangler.json > tmp.json
mv tmp.json wrangler.json
- name: Format JSON files with Biome
run: |
BIOME_VERSION=$(nix eval .#meta.package.devDependencies."@biomejs/biome" --raw)
nix develop --command bunx "@biomejs/biome@$BIOME_VERSION" check --write renovate.json wrangler.json
- uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7
with:
commit_message: "chore(config): sync config files with flake.lock"