#59 - Use pull_request_target event in PR workflow to support fork CI with secrets #60
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openrn/react-native-logging-tools!60
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "59-Use-pull_request_target-event-in-PR-workflow-to-support-fork-CI-with-secrets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Switch the PR workflow trigger from
pull_requesttopull_request_targetsothat the full CI pipeline (including Sonar analysis) runs for fork PRs. All
actions/checkout@v4steps are updated to check out the PR head commitexplicitly via
ref: ${{ github.event.pull_request.head.sha }}.Type of Change
not work as expected)
Related Issue
Fixes #59
Testing
all jobs (prettier, tsc, lint, unit-testing, sonar) ran successfully with
access to secrets
Breaking Changes
None. This change only affects how the CI workflow is triggered; no code, API,
or configuration changes are made to the library itself.
Checklist
Additional Notes
Security consideration: Using
ref: ${{ github.event.pull_request.head.sha }}pins the checkout to the exactSHA the contributor pushed, avoiding the ambiguity of the auto-merged ref. This
is the recommended approach for
pull_request_targetin Forgejo to avoidrunning untrusted code from a stale or manipulated merge commit.
The Sonar job's existing
if:condition remains unchanged — it still only runswhen
SONAR_TOKEN,SONAR_HOST_URL,SONAR_PROJECT_KEY, andSONAR_PROJECT_NAMEare all configured.pull_request_targetto support fork CI with secretspull_requestandpull_request_targetfor improved CI event handling