You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR extends the create-pull-request action to support creating pull requests in repositories other than the one where the action is running. The key change is dynamically determining the target repository using gh repo view instead of hardcoding $GITHUB_REPOSITORY. This enables workflows in SonarSource to replace their dependency on peter-evans/create-pull-request with their own implementation, making it possible to create PRs across different repositories in a unified way.
Core change location:create-pull-request/action.yml (lines 250-264, 404) — The action now queries the target repo dynamically and passes it through to API calls, rather than assuming it's always the current repository.
Workflow updates: Two actions that previously used peter-evans/create-pull-request (sonar-update-center-release and update-analyzer) now use the local action instead. The update-action-versions workflow has been refactored to use the local action and simplified by removing manual change detection (the action now handles this internally).
Non-obvious decisions:
The repo is detected using gh repo view --json nameWithOwner — reviewers should verify this works across different token scopes and repository configurations
The create-pull-request action outputs the resolved repo name, allowing callers to know which repository the PR was created in
Token handling changes: sonar-update-center-release removes the explicit token input (presumably using the default runner token), while update-analyzer retains its vault-sourced token
Test coverage to verify: Cross-repository PR creation with different token types, and backward compatibility when the action is used on its own repository
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
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.
Part of