Skip to content

Commit c4f6622

Browse files
authored
Merge pull request #1107 from jbw976/nix-dupe
fix(ci): pin which Nix Renovate's post-upgrade tasks use
2 parents fc7bf6f + 3a3dd2c commit c4f6622

3 files changed

Lines changed: 15 additions & 5 deletions

File tree

.github/renovate-entrypoint.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ extra-substituters = https://crossplane.cachix.org
4242
extra-trusted-public-keys = crossplane.cachix.org-1:NJluVUN9TX0rY/zAxHYaT19Y5ik4ELH4uFuxje+62d4=
4343
EOF
4444

45-
echo "Nix $(nix --version) installed successfully"
45+
# Renovate installs its own Nix when it updates flake.lock. It goes earlier on
46+
# PATH than ours and ignores the config above, so all nix commands we run (e.g.
47+
# postUpgradeTasks) will go through this launcher, which pins both the binary
48+
# and the config it reads.
49+
cat > /usr/local/bin/crossplane-nix << 'EOF'
50+
#!/bin/bash
51+
exec env NIX_CONF_DIR=/etc/nix /usr/bin/nix "$@"
52+
EOF
53+
chmod +x /usr/local/bin/crossplane-nix
54+
55+
echo "Nix $(crossplane-nix --version) installed successfully"
4656

4757
renovate

.github/renovate-nix.json5

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
],
5757
postUpgradeTasks: {
5858
commands: [
59-
'nix run .#tidy',
60-
'nix run .#generate',
59+
'crossplane-nix run .#tidy',
60+
'crossplane-nix run .#generate',
6161
],
6262
fileFilters: [
6363
'**/*',
@@ -77,7 +77,7 @@
7777
],
7878
postUpgradeTasks: {
7979
commands: [
80-
'nix run .#lint',
80+
'crossplane-nix run .#lint',
8181
],
8282
fileFilters: [
8383
'**/*',

.github/workflows/renovate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
# Use GitHub API to create commits
5252
RENOVATE_PLATFORM_COMMIT: "true"
5353
LOG_LEVEL: ${{ github.event.inputs.logLevel || env.LOG_LEVEL }}
54-
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^nix .+", "^earthly .+"]'
54+
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^crossplane-nix .+", "^earthly .+"]'
5555
with:
5656
configurationFile: .github/renovate.json5
5757
token: '${{ steps.get-github-app-token.outputs.token }}'

0 commit comments

Comments
 (0)