Skip to content

Commit 3f4bee2

Browse files
committed
ci: report e2e-* checks on fork and Dependabot PRs
The e2e job is skipped on PRs that can't access repository secrets (forks and Dependabot). Because it's skipped via a job-level `if`, its matrix never expands, so the required e2e-* check contexts are never created and branch protection waits on them indefinitely, blocking merge. Add an e2e-bypass job whose `if` is the exact negation of the e2e job's run condition. It emits the same e2e-* check names with a passing status for fork/Dependabot PRs, satisfying branch protection without running the real tests. The two jobs are mutually exclusive and exhaustive: every PR runs exactly one. Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
1 parent a486d4a commit 3f4bee2

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/e2e-test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,34 @@ jobs:
104104
env:
105105
SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_CLI_API_TOKEN }}
106106
run: bash ${{ matrix.validate }}
107+
108+
# Branch protection requires the e2e-* checks, but the `e2e` job above is
109+
# skipped on PRs that can't access repository secrets -- fork PRs and
110+
# Dependabot PRs. A job skipped via a job-level `if` never expands its
111+
# matrix, so the e2e-* check contexts are never created and the required
112+
# checks sit at "Expected -- Waiting for status to be reported" forever,
113+
# permanently blocking merge.
114+
#
115+
# This bypass reports a green status under the SAME e2e-* check names for
116+
# exactly those PRs, satisfying branch protection without running the real
117+
# tests (which need SOCKET_CLI_API_TOKEN). Its `if` is the precise negation
118+
# of the e2e job's run condition, so the two are mutually exclusive: any
119+
# given PR runs one or the other, never both, and never neither.
120+
#
121+
# Dependency-bump risk on these PRs is still covered by dependency-review.yml's
122+
# Socket Firewall smoke jobs, which run without repository secrets.
123+
e2e-bypass:
124+
if: >-
125+
github.event_name == 'pull_request' &&
126+
(github.event.pull_request.head.repo.full_name != github.repository ||
127+
github.event.pull_request.user.login == 'dependabot[bot]')
128+
runs-on: ubuntu-latest
129+
strategy:
130+
matrix:
131+
name: [scan, sarif, reachability, gitlab, json, pypi]
132+
name: e2e-${{ matrix.name }}
133+
steps:
134+
- name: Report skip status
135+
run: |
136+
echo "Skipping e2e-${{ matrix.name }} for a PR without repository secrets"
137+
echo "(fork or Dependabot). Dependency risk is covered by dependency-review.yml."

0 commit comments

Comments
 (0)