Fix pipeline to not fail on PRs from forked repos#376
Open
Conversation
baonguyenNava
approved these changes
Mar 23, 2026
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.
Summary
Improves GitHub Actions behavior for pull requests from forks so CI fails for the right reasons (real test/lint failures) instead of infrastructure limits (checkout, OIDC/AWS, or misleading e2e failures).
Changes
OpenAPI workflow (
ci-reporting-app-openapi.yml)github.event.pull_request.head.shainstead ofgithub.head_ref, so the job can fetch the PR head when the branch exists only on the fork.git push: after SHA checkout (detached HEAD), rungit checkout -B ${{ github.head_ref }}so the existing “commit + push OpenAPI updates” step still works for same-repo PRs.PR environment + E2E (
ci-reporting-app-pr-environment-checks.yml)pr-environment-checksworkflow (build → AWS → deploy PR env → e2e) so it runs only for:workflow_dispatch, orpull_request(head.repo.full_name == github.repository) while the PR is open.id-token/OIDC for fork-originatedpull_requestworkflows the same way, so AWS credentials and downstream e2e would fail regardless of code quality.fork-pr-skip-noticejob: runs on open fork PRs only, succeeds with an Actions notice explaining why PR env + e2e were skipped and how to validate (merge, upstream branch, or manual dispatch).Preview environment for reporting-app