Skip to content

Commit

Permalink
chore(internal): on forks, don't run jobs that require secrets or cus…
Browse files Browse the repository at this point in the history
…tom runners (#5834)

* chore(internal): don't run secret-requiring github actions on forks

* Also don't run jobs that require custom runners
  • Loading branch information
zachkirsch authored Feb 2, 2025
1 parent c0f643f commit f3ca091
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
run: git --no-pager diff --exit-code

compile:
if: github.repository == 'fern-api/fern'
runs-on: CLI
steps:
- name: Checkout repo
Expand All @@ -69,6 +70,7 @@ jobs:
run: pnpm lint:eslint

test:
if: github.repository == 'fern-api/fern'
runs-on: Test
steps:
- name: Checkout repo
Expand All @@ -95,6 +97,7 @@ jobs:
run: git --no-pager diff --exit-code

ete-tests:
if: github.repository == 'fern-api/fern'
runs-on: CLI
steps:
- name: Checkout repo
Expand All @@ -117,7 +120,7 @@ jobs:

live-test-dev:
environment: Fern Dev
if: github.ref == 'refs/heads/main'
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'fern-api/fern' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repo
Expand All @@ -139,7 +142,7 @@ jobs:
live-test-dev-windows:
environment: Fern Dev
if: github.ref == 'refs/heads/main'
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'fern-api/fern' }}
runs-on: windows-latest
steps:
- name: Checkout repo
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/create-cli-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ env:

jobs:
release-cli:
if: github.repository == 'fern-api/fern'
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
publish-dev:
if: ${{ inputs.version == null }}
if: ${{ inputs.version == null && github.repository == 'fern-api/fern' }}
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.FERN_NPM_TOKEN }}
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
# Test prod and try to publish, the publish command will handle if there's no diff
live-test:
if: ${{ inputs.version == null }}
if: ${{ inputs.version == null && github.repository == 'fern-api/fern' }}
environment: Fern Prod
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

jobs:
run:
if: github.repository == 'fern-api/fern'
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/seed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ jobs:
typescript-sdk:
runs-on: Seed
needs: changes
if: ${{ needs.changes.outputs.typescript == 'true' || needs.changes.outputs.seed == 'true' }}
if: ${{ (needs.changes.outputs.typescript == 'true' || needs.changes.outputs.seed == 'true') && github.repository == 'fern-api/fern' }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand Down

0 comments on commit f3ca091

Please sign in to comment.