Skip to content

Commit

Permalink
Prevent PRs outside of TryGhost org from attempting browser tests
Browse files Browse the repository at this point in the history
no issue
  • Loading branch information
sam-lord committed Apr 23, 2024
1 parent a2bbe6b commit 6ac6c6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ jobs:
base_commit: ${{ env.BASE_COMMIT }}
is_canary_branch: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/arch') }}
is_main: ${{ github.ref == 'refs/heads/main' }}
is_fork: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}
has_browser_tests_label: ${{ github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'browser-tests') }}

job_install_deps:
Expand Down Expand Up @@ -291,7 +292,7 @@ jobs:
runs-on:
labels: ubuntu-latest
needs: [job_get_metadata, job_install_deps]
if: needs.job_get_metadata.outputs.changed_any_code == 'true' && (needs.job_get_metadata.outputs.is_main == 'true' || needs.job_get_metadata.outputs.has_browser_tests_label == 'true')
if: needs.job_get_metadata.outputs.changed_any_code == 'true' && needs.job_get_metadata.outputs.is_fork != 'true' && (needs.job_get_metadata.outputs.is_main == 'true' || needs.job_get_metadata.outputs.has_browser_tests_label == 'true')
concurrency:
group: ${{ github.workflow }}
steps:
Expand Down

0 comments on commit 6ac6c6d

Please sign in to comment.