Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ on:
tags:
- "v*"

pull_request:
# pull_request_target runs in the context of the base branch, giving the
# workflow access to repository secrets even for Dependabot PRs (which only
# receive Dependabot-scoped secrets under the plain pull_request event).
# The checkout step below pins to the PR head SHA so the actual PR code is
# tested, not the base-branch code.
pull_request_target:
branches: [main, dev]
types: [opened, synchronize, reopened]

Expand All @@ -38,10 +43,22 @@ jobs:
runs-on: [self-hosted, e2e, azure]
timeout-minutes: 45
environment: e2e-testing
# For pull_request_target, only run when the PR originates from the same
# repository (team members) or from dependabot[bot]. External fork PRs
# must NOT receive repository secrets, even though pull_request_target
# would otherwise grant them access.
if: |
github.event_name != 'pull_request_target' ||
github.event.pull_request.head.repo.full_name == github.repository ||
github.actor == 'dependabot[bot]'

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# Explicitly check out the PR head commit; with pull_request_target
# the default checkout is the base branch, not the PR branch.
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Go
uses: actions/setup-go@v5
Expand Down