workflows/build: run trusted nix-build-uncached

This was previously run from the untrusted checkout, which would allow
extracting the cachix secret easily.
This commit is contained in:
Wolfgang Walther
2025-11-10 14:14:53 +01:00
parent e18eeeb441
commit c2cb4e916b
2 changed files with 6 additions and 1 deletions

View File

@@ -12,6 +12,9 @@ on:
mergedSha: mergedSha:
required: true required: true
type: string type: string
targetSha:
required: true
type: string
secrets: secrets:
CACHIX_AUTH_TOKEN: CACHIX_AUTH_TOKEN:
required: true required: true
@@ -55,6 +58,7 @@ jobs:
uses: ./.github/actions/checkout uses: ./.github/actions/checkout
with: with:
merged-as-untrusted-at: ${{ inputs.mergedSha }} merged-as-untrusted-at: ${{ inputs.mergedSha }}
target-as-trusted-at: ${{ inputs.targetSha }}
- uses: cachix/install-nix-action@456688f15bc354bef6d396e4a35f4f89d40bf2b7 # v31 - uses: cachix/install-nix-action@456688f15bc354bef6d396e4a35f4f89d40bf2b7 # v31
with: with:
@@ -69,7 +73,7 @@ jobs:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
pushFilter: '(-source$|-nixpkgs-tarball-)' pushFilter: '(-source$|-nixpkgs-tarball-)'
- run: nix-env --install -f nixpkgs/untrusted-pinned -A nix-build-uncached - run: nix-env --install -f nixpkgs/trusted-pinned -A nix-build-uncached
- name: Build shell - name: Build shell
if: contains(matrix.builds, 'shell') if: contains(matrix.builds, 'shell')

View File

@@ -119,6 +119,7 @@ jobs:
artifact-prefix: ${{ inputs.artifact-prefix }} artifact-prefix: ${{ inputs.artifact-prefix }}
baseBranch: ${{ needs.prepare.outputs.baseBranch }} baseBranch: ${{ needs.prepare.outputs.baseBranch }}
mergedSha: ${{ needs.prepare.outputs.mergedSha }} mergedSha: ${{ needs.prepare.outputs.mergedSha }}
targetSha: ${{ needs.prepare.outputs.targetSha }}
# This job's only purpose is to create the target for the "Required Status Checks" branch ruleset. # This job's only purpose is to create the target for the "Required Status Checks" branch ruleset.
# It "needs" all the jobs that should block merging a PR. # It "needs" all the jobs that should block merging a PR.