Skip to content

ci: check repo before running publish jobs #3407

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

Merged
merged 3 commits into from
Jun 5, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/build_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ concurrency:

jobs:
deploy:
if: github.repository == 'nix-community/nixvim'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/flakehub-publish-rolling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- "main"
jobs:
flakehub-publish:
if: github.repository == 'nix-community/nixvim'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better practice to check necessary variables are present instead of checking the repo or owner. That approach would allow deliberate testing of forks while still preventing accidental runs.

This PR is still good to merge if we don't have the energy to find a better solution right now.

runs-on: "ubuntu-latest"
permissions:
id-token: "write"
Expand All @@ -14,6 +15,6 @@ jobs:
- uses: "DeterminateSystems/nix-installer-action@main"
- uses: "DeterminateSystems/flakehub-push@main"
with:
name: "nix-community/nixvim"
name: ${{ github.repository }}
rolling: true
visibility: "public"
2 changes: 2 additions & 0 deletions .github/workflows/flakestry-publish-rolling.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: Publish every git push to Flakestry
on:
push:
branches:
Expand All @@ -10,6 +11,7 @@ on:
required: true
jobs:
publish-flake:
if: github.event_name != 'push' || github.repository == 'nix-community/nixvim'
runs-on: ubuntu-latest
permissions:
id-token: "write"
Expand Down