Skip to content

Run integration tests for PRs from forks#3870

Draft
fpighi wants to merge 1 commit into
masterfrom
fpighi/fork-pr-integration-tests-dd-sts
Draft

Run integration tests for PRs from forks#3870
fpighi wants to merge 1 commit into
masterfrom
fpighi/fork-pr-integration-tests-dd-sts

Conversation

@fpighi
Copy link
Copy Markdown
Member

@fpighi fpighi commented Jun 5, 2026

What

The integration-test workflows now mint short-lived Datadog credentials at job time over GitHub OIDC (via DataDog/dd-sts-action) instead of reading long-lived API/APP keys from repository secrets. PR runs use pull_request_target, and PRs from forks run in a protected forks-prs environment.

Why

PRs opened from forks don't have access to repository secrets, so the integration test jobs could not authenticate and had to be skipped and merged manually. This lets fork PRs run integration tests while removing long-lived credentials from the repository.

Changes

  • pull_requestpull_request_target on both integration-test workflows.
  • Credentials are minted per run via DataDog/dd-sts-action (short-lived, test-org scoped); DD_TEST_CLIENT_* now come from the action outputs and the static secret references are removed.
  • id-token: write is granted only on the credentialed jobs (the unprivileged jobs cannot mint tokens).
  • Fork PRs run in the forks-prs environment; same-repo PRs and the scheduled run are unaffected.
  • The PR test-selection job no longer executes untrusted PR code: it checks out the trusted base, fetches the PR head, and diffs by filename only.

Required to land / follow-ups

  • Depends on the server-side OIDC trust configuration being deployed first.
  • Requires a forks-prs environment configured in repository settings.
  • The static DD_CLIENT_API_KEY / DD_CLIENT_APP_KEY secrets can be removed once this is validated.

Security note

pull_request_target runs the base branch's workflow definition but the credentialed job checks out and runs the PR's code. Fork PRs run in the protected forks-prs environment, and minted credentials are short-lived and scoped to a dedicated test org.

PRs opened from forks cannot read repository secrets, so the integration
test jobs failed to authenticate and had to be skipped and merged manually.
Mint short-lived Datadog credentials at job time over OIDC instead of
reading long-lived API/APP keys from secrets, and run fork PRs in a
protected environment.
@fpighi fpighi force-pushed the fpighi/fork-pr-integration-tests-dd-sts branch from 78b1637 to 5128417 Compare June 5, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant