Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Commit 808a788

Browse files
committed
chore: don't try to set commit status for forked PRs in e2e tests
1 parent cb97e25 commit 808a788

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
run: npx codecov
3939

4040
start-e2e-tests:
41+
# Note: we only run e2e tests automatically if this PR is not from a fork, as forks won't have access to secrets
42+
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
4143
needs: [build]
4244
runs-on: [ubuntu-latest]
4345

@@ -52,8 +54,6 @@ jobs:
5254
sha: ${{ github.event.pull_request.head.sha || github.sha }}
5355

5456
- name: Trigger end-to-end tests workflow
55-
# Note: we only run e2e tests automatically if this PR is not from a fork, as forks won't have access to secrets
56-
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }}
5757
uses: benc-uk/workflow-dispatch@v1
5858
with:
5959
workflow: End-to-end Tests

.github/workflows/e2e-tests.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
echo "::set-output name=pr_git_sha::$(git rev-parse HEAD)"
3434
3535
- name: Mark end-to-end tests as pending with run URL
36+
# For manual runs (e.g for fork PRs) don't update commit status as there won't be permissions to do so
37+
if: ${{ github.event.inputs.pull_request_id != '' }}
3638
uses: Sibz/github-status-action@v1
3739
with:
3840
authToken: ${{ secrets.GITHUB_TOKEN }}
@@ -97,7 +99,8 @@ jobs:
9799
yarn e2e:ci
98100
99101
- name: Mark end-to-end tests as failed
100-
if: ${{ failure() }}
102+
# For manual runs (e.g for fork PRs) don't update commit status as there won't be permissions to do so
103+
if: ${{ failure() && github.event.inputs.pull_request_id != '' }}
101104
uses: Sibz/github-status-action@v1
102105
with:
103106
authToken: ${{ secrets.GITHUB_TOKEN }}
@@ -113,6 +116,8 @@ jobs:
113116

114117
steps:
115118
- name: Mark end-to-end tests as succeeded
119+
# For manual runs (e.g for fork PRs) don't update commit status as there won't be permissions to do so
120+
if: ${{ github.event.inputs.pull_request_id != '' }}
116121
uses: Sibz/github-status-action@v1
117122
with:
118123
authToken: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)