-
Notifications
You must be signed in to change notification settings - Fork 11
post-inventory command, plus a toggle to turn off cache.nixos.org #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
634b46a
d3c81b5
ef8ae33
bbcfbf0
54f059b
a77a72c
6c44412
b9d4c43
0d18a34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -53,6 +53,20 @@ on: | |||||||||||||||
| required: false | ||||||||||||||||
| type: string | ||||||||||||||||
| default: "" | ||||||||||||||||
| disable-cache-nixos-org: | ||||||||||||||||
| description: | | ||||||||||||||||
| Whether to disable cache.nixos.org as a substituter | ||||||||||||||||
| required: false | ||||||||||||||||
| type: boolean | ||||||||||||||||
| default: false | ||||||||||||||||
| post-inventory-commands: | ||||||||||||||||
| description: | | ||||||||||||||||
| A command or set of commands to run at the end of the Inventory job. | ||||||||||||||||
|
|
||||||||||||||||
| For example, a linting step. | ||||||||||||||||
| required: false | ||||||||||||||||
| type: string | ||||||||||||||||
| default: "" | ||||||||||||||||
| outputs: | ||||||||||||||||
| flake_name: | ||||||||||||||||
| value: ${{ jobs.success.outputs.flake_name }} | ||||||||||||||||
|
|
@@ -101,7 +115,21 @@ jobs: | |||||||||||||||
| # disabled pending strategy discussion on exposing tunables | ||||||||||||||||
| # - uses: Determinatesystems/flake-checker-action@main | ||||||||||||||||
| - uses: DeterminateSystems/determinate-nix-action@v3 | ||||||||||||||||
| with: | ||||||||||||||||
| extra-conf: | | ||||||||||||||||
| ${{ (inputs.disable-cache-nixos-org == true) && 'substituters =' || '' }} | ||||||||||||||||
| - uses: DeterminateSystems/flakehub-cache-action@main | ||||||||||||||||
| - &policy_step | ||||||||||||||||
| name: "Configuration policy checks" | ||||||||||||||||
| if: ${{ inputs.disable-cache-nixos-org == true }} | ||||||||||||||||
| run: | | ||||||||||||||||
| if nix config show substituters | grep -q cache.nixos.org; then | ||||||||||||||||
| echo "❌ Nix has cache.nixos.org enabled as a substituter, which is prohibited by configuration:" | ||||||||||||||||
| nix config show substituters | ||||||||||||||||
| exit 1 | ||||||||||||||||
| else | ||||||||||||||||
| echo "✅ Nix does not have cache.nixos.org enabled as a substituter." | ||||||||||||||||
| fi | ||||||||||||||||
| - uses: webfactory/ssh-agent@v0.9.0 | ||||||||||||||||
| if: ${{ inputs.enable-ssh-agent }} | ||||||||||||||||
| with: | ||||||||||||||||
|
|
@@ -114,6 +142,9 @@ jobs: | |||||||||||||||
| working-directory: ${{ inputs.directory }} | ||||||||||||||||
| run: | | ||||||||||||||||
| nix run "$FLAKE_ITER_FLAKEREF" -- systems | ||||||||||||||||
| - name: Post-inventory commands | ||||||||||||||||
| if: ${{ inputs.post-inventory-commands != '' }} | ||||||||||||||||
| run: ${{ inputs.post-inventory-commands }} | ||||||||||||||||
|
Comment on lines
+145
to
+147
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Run post-inventory commands in the configured flake directory. On Line 127, commands run from the repository root, but the inventory command runs in Suggested fix - name: Post-inventory commands
if: ${{ inputs.post-inventory-commands != '' }}
+ working-directory: ${{ inputs.directory }}
run: ${{ inputs.post-inventory-commands }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| build: | ||||||||||||||||
| runs-on: ${{ matrix.systems.runner }} | ||||||||||||||||
| needs: inventory | ||||||||||||||||
|
|
@@ -133,7 +164,9 @@ jobs: | |||||||||||||||
| extra-conf: | | ||||||||||||||||
| extra-experimental-features = provenance | ||||||||||||||||
| ${{ inputs.extra-nix-conf }} | ||||||||||||||||
| ${{ (inputs.disable-cache-nixos-org == true) && 'substituters =' || '' }} | ||||||||||||||||
| - uses: DeterminateSystems/flakehub-cache-action@main | ||||||||||||||||
| - *policy_step | ||||||||||||||||
| - uses: webfactory/ssh-agent@v0.9.0 | ||||||||||||||||
| if: ${{ inputs.enable-ssh-agent }} | ||||||||||||||||
| with: | ||||||||||||||||
|
|
@@ -147,7 +180,9 @@ jobs: | |||||||||||||||
|
|
||||||||||||||||
| success: | ||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||
| needs: build | ||||||||||||||||
| needs: | ||||||||||||||||
| - inventory | ||||||||||||||||
| - build | ||||||||||||||||
| if: ${{ always() }} | ||||||||||||||||
| permissions: | ||||||||||||||||
| id-token: write | ||||||||||||||||
|
|
@@ -169,9 +204,22 @@ jobs: | |||||||||||||||
| - uses: actions/checkout@main | ||||||||||||||||
| if: ${{ !github.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }} | ||||||||||||||||
| - uses: DeterminateSystems/determinate-nix-action@v3 | ||||||||||||||||
| with: | ||||||||||||||||
| extra-conf: | | ||||||||||||||||
| ${{ (inputs.disable-cache-nixos-org == true) && 'substituters =' || '' }} | ||||||||||||||||
| if: ${{ !github.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }} | ||||||||||||||||
| - uses: DeterminateSystems/flakehub-cache-action@main | ||||||||||||||||
| if: ${{ !github.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }} | ||||||||||||||||
| - name: "Configuration policy checks" | ||||||||||||||||
| if: ${{ inputs.disable-cache-nixos-org == true && (!github.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/'))) }} | ||||||||||||||||
| run: | | ||||||||||||||||
| if nix config show substituters | grep -q cache.nixos.org; then | ||||||||||||||||
| echo "❌ Nix has cache.nixos.org enabled as a substituter, which is prohibited by configuration:" | ||||||||||||||||
| nix config show substituters | ||||||||||||||||
| exit 1 | ||||||||||||||||
| else | ||||||||||||||||
| echo "✅ Nix does not have cache.nixos.org enabled as a substituter." | ||||||||||||||||
| fi | ||||||||||||||||
| - uses: DeterminateSystems/flakehub-push@main | ||||||||||||||||
| if: ${{ !github.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }} | ||||||||||||||||
| id: publish | ||||||||||||||||
|
|
||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.