Add repository guards to deployment workflows (#877)
- Guard deploy-docs job to only run in canonical repository - Guard goreleaser job to only run in canonical repository - Guard update-homebrew job to only run in canonical repository - Guard test-pypi job to only run in canonical repository Prevents fork workflows from attempting to deploy, release, or publish to external services.
This commit is contained in:
2
.github/workflows/deploy-docs.yml
vendored
2
.github/workflows/deploy-docs.yml
vendored
@@ -83,6 +83,8 @@ jobs:
|
||||
path: website/build
|
||||
|
||||
deploy:
|
||||
# Guard: deploy should only run in the canonical repository (not in forks)
|
||||
if: ${{ github.repository == 'steveyegge/beads' }}
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
|
||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -15,6 +15,8 @@ permissions:
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
# Guard: only run goreleaser in the canonical repository (not in forks)
|
||||
if: ${{ github.repository == 'steveyegge/beads' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
2
.github/workflows/test-pypi.yml
vendored
2
.github/workflows/test-pypi.yml
vendored
@@ -5,6 +5,8 @@ on:
|
||||
|
||||
jobs:
|
||||
test-publish:
|
||||
# Guard: only allow test PyPI publish runs in the canonical repository
|
||||
if: ${{ github.repository == 'steveyegge/beads' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
2
.github/workflows/update-homebrew.yml
vendored
2
.github/workflows/update-homebrew.yml
vendored
@@ -14,6 +14,8 @@ permissions:
|
||||
|
||||
jobs:
|
||||
update-formula:
|
||||
# Guard: only run homebrew update in the canonical repository (not in forks)
|
||||
if: ${{ github.repository == 'steveyegge/beads' }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout beads repo
|
||||
|
||||
Reference in New Issue
Block a user