workflows/pull-request-target: never write to cachix from PRs
Evaluating untrusted code in the presence of secrets is unsafe in general, thus we only provide the cachix auth token when these jobs run in the merge queue. This is enough for all practical purposes, PRs will be able to pull stuff from cachix that was built in the Merge Queue previously.
This commit is contained in:
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -16,8 +16,10 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
secrets:
|
secrets:
|
||||||
|
# Should only be provided in the merge queue, not in pull requests,
|
||||||
|
# where we're evaluating untrusted code.
|
||||||
CACHIX_AUTH_TOKEN:
|
CACHIX_AUTH_TOKEN:
|
||||||
required: true
|
required: false
|
||||||
|
|
||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/check.yml
vendored
4
.github/workflows/check.yml
vendored
@@ -16,8 +16,10 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
secrets:
|
secrets:
|
||||||
|
# Should only be provided in the merge queue, not in pull requests,
|
||||||
|
# where we're evaluating untrusted code.
|
||||||
CACHIX_AUTH_TOKEN:
|
CACHIX_AUTH_TOKEN:
|
||||||
required: true
|
required: false
|
||||||
|
|
||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/eval.yml
vendored
4
.github/workflows/eval.yml
vendored
@@ -19,8 +19,10 @@ on:
|
|||||||
default: false
|
default: false
|
||||||
type: boolean
|
type: boolean
|
||||||
secrets:
|
secrets:
|
||||||
|
# Should only be provided in the merge queue, not in pull requests,
|
||||||
|
# where we're evaluating untrusted code.
|
||||||
CACHIX_AUTH_TOKEN:
|
CACHIX_AUTH_TOKEN:
|
||||||
required: true
|
required: false
|
||||||
|
|
||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@@ -10,8 +10,10 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
secrets:
|
secrets:
|
||||||
|
# Should only be provided in the merge queue, not in pull requests,
|
||||||
|
# where we're evaluating untrusted code.
|
||||||
CACHIX_AUTH_TOKEN:
|
CACHIX_AUTH_TOKEN:
|
||||||
required: true
|
required: false
|
||||||
|
|
||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
|
|||||||
3
.github/workflows/merge-group.yml
vendored
3
.github/workflows/merge-group.yml
vendored
@@ -13,9 +13,6 @@ on:
|
|||||||
targetSha:
|
targetSha:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
secrets:
|
|
||||||
CACHIX_AUTH_TOKEN:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
|
|||||||
10
.github/workflows/pull-request-target.yml
vendored
10
.github/workflows/pull-request-target.yml
vendored
@@ -8,8 +8,6 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
secrets:
|
secrets:
|
||||||
CACHIX_AUTH_TOKEN:
|
|
||||||
required: true
|
|
||||||
NIXPKGS_CI_APP_PRIVATE_KEY:
|
NIXPKGS_CI_APP_PRIVATE_KEY:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
@@ -63,8 +61,6 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
# cherry-picks
|
# cherry-picks
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
secrets:
|
|
||||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
baseBranch: ${{ needs.prepare.outputs.baseBranch }}
|
baseBranch: ${{ needs.prepare.outputs.baseBranch }}
|
||||||
headBranch: ${{ needs.prepare.outputs.headBranch }}
|
headBranch: ${{ needs.prepare.outputs.headBranch }}
|
||||||
@@ -75,8 +71,6 @@ jobs:
|
|||||||
name: Lint
|
name: Lint
|
||||||
needs: [prepare]
|
needs: [prepare]
|
||||||
uses: ./.github/workflows/lint.yml
|
uses: ./.github/workflows/lint.yml
|
||||||
secrets:
|
|
||||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
mergedSha: ${{ needs.prepare.outputs.mergedSha }}
|
mergedSha: ${{ needs.prepare.outputs.mergedSha }}
|
||||||
targetSha: ${{ needs.prepare.outputs.targetSha }}
|
targetSha: ${{ needs.prepare.outputs.targetSha }}
|
||||||
@@ -88,8 +82,6 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
# compare
|
# compare
|
||||||
statuses: write
|
statuses: write
|
||||||
secrets:
|
|
||||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
artifact-prefix: ${{ inputs.artifact-prefix }}
|
artifact-prefix: ${{ inputs.artifact-prefix }}
|
||||||
mergedSha: ${{ needs.prepare.outputs.mergedSha }}
|
mergedSha: ${{ needs.prepare.outputs.mergedSha }}
|
||||||
@@ -113,8 +105,6 @@ jobs:
|
|||||||
name: Build
|
name: Build
|
||||||
needs: [prepare]
|
needs: [prepare]
|
||||||
uses: ./.github/workflows/build.yml
|
uses: ./.github/workflows/build.yml
|
||||||
secrets:
|
|
||||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
artifact-prefix: ${{ inputs.artifact-prefix }}
|
artifact-prefix: ${{ inputs.artifact-prefix }}
|
||||||
baseBranch: ${{ needs.prepare.outputs.baseBranch }}
|
baseBranch: ${{ needs.prepare.outputs.baseBranch }}
|
||||||
|
|||||||
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
@@ -84,8 +84,6 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
statuses: write
|
statuses: write
|
||||||
secrets:
|
|
||||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
||||||
with:
|
with:
|
||||||
artifact-prefix: mg-
|
artifact-prefix: mg-
|
||||||
mergedSha: ${{ needs.prepare.outputs.mergedSha }}
|
mergedSha: ${{ needs.prepare.outputs.mergedSha }}
|
||||||
@@ -102,7 +100,6 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
statuses: write
|
statuses: write
|
||||||
secrets:
|
secrets:
|
||||||
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
||||||
NIXPKGS_CI_APP_PRIVATE_KEY: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
NIXPKGS_CI_APP_PRIVATE_KEY: ${{ secrets.NIXPKGS_CI_APP_PRIVATE_KEY }}
|
||||||
with:
|
with:
|
||||||
artifact-prefix: pr-
|
artifact-prefix: pr-
|
||||||
|
|||||||
Reference in New Issue
Block a user