Run integration tests for PRs from forks#3870
Draft
fpighi wants to merge 1 commit into
Draft
Conversation
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.
78b1637 to
5128417
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 usepull_request_target, and PRs from forks run in a protectedforks-prsenvironment.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_request→pull_request_targeton both integration-test workflows.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: writeis granted only on the credentialed jobs (the unprivileged jobs cannot mint tokens).forks-prsenvironment; same-repo PRs and the scheduled run are unaffected.Required to land / follow-ups
forks-prsenvironment configured in repository settings.DD_CLIENT_API_KEY/DD_CLIENT_APP_KEYsecrets can be removed once this is validated.Security note
pull_request_targetruns the base branch's workflow definition but the credentialed job checks out and runs the PR's code. Fork PRs run in the protectedforks-prsenvironment, and minted credentials are short-lived and scoped to a dedicated test org.