Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ on:
required: false
type: string
default: ""
allow-fork:
description: |
The `owner/repo` name of a fork that is allowed to publish to FlakeHub.
Publishing from a fork is skipped unless `github.repository` matches this value exactly.
Forks of the named repository still skip publishing.

Example: `DeterminateSystems/nix-eval-jobs`
required: false
type: string
default: ""
outputs:
flake_name:
value: ${{ jobs.success.outputs.flake_name }}
Expand Down Expand Up @@ -171,15 +181,15 @@ jobs:
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
if: ${{ !github.event.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }}
if: ${{ (!github.event.repository.fork || (inputs.allow-fork != '' && github.repository == inputs.allow-fork)) && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }}
with:
persist-credentials: false
- uses: DeterminateSystems/determinate-nix-action@main
if: ${{ !github.event.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }}
if: ${{ (!github.event.repository.fork || (inputs.allow-fork != '' && github.repository == inputs.allow-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.event.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }}
if: ${{ (!github.event.repository.fork || (inputs.allow-fork != '' && github.repository == inputs.allow-fork)) && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }}
- uses: DeterminateSystems/flakehub-push@main
if: ${{ !github.event.repository.fork && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }}
if: ${{ (!github.event.repository.fork || (inputs.allow-fork != '' && github.repository == inputs.allow-fork)) && inputs.visibility != '' && (github.ref == format('refs/heads/{0}', inputs.default-branch) || startsWith(github.ref, 'refs/tags/')) }}
id: publish
with:
rolling: ${{ github.ref == format('refs/heads/{0}', inputs.default-branch) }}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ You'll see something like this when your workflow has run successfully:
| `fail-fast` | Whether to cancel all in-progress jobs if any matrix job fails | `true` |
| `runner-map` | A custom mapping of [Nix system types][nix-system] to desired Actions runners | `{ "aarch64-darwin": "macos-latest", "x86_64-linux": "ubuntu-latest", "aarch64-linux": "ubuntu-latest" }` |
| `extra-nix-conf` | Extra Nix configuration to pass to Determinate Nix | |
| `allow-fork` | The `owner/repo` name of a fork that is allowed to publish to FlakeHub. Forks skip publishing unless `github.repository` matches this value exactly. | |

## Example configurations

Expand Down
Loading