Skipping SonarQube analysis on fork repos and adding POWPEG_REPO_OWNER input #316
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.
Description
Right now, checks for pull requests (PRs) from external contributors using forked repositories are not passing. The main issue is that the rootstock-integration-tests workflow is attempting to find the branch in the original rsksmart/powpeg repository instead of the contributor's fork. Here are the specific problems we've encountered:
Git Checkout Error: error: pathspec 'vovchyk/status-badge' did not match any file(s) known to git
and
It appears that the SonarQube check is being triggered automatically for external PRs of branches from forked repos, which should not happen due to potential access issues
Implementation
Updated
rit.yml
Workflow:Added the repo-owner input to the Rootstock Integration Tests action to ensure it correctly clones the repository based on the PR's owner:
Conditionally Trigger SonarQube Check:
Implemented logic to skip the SonarQube check for PRs from external contributors. This prevents unnecessary execution that could fail due to access issues.
if [ "$GH_EVENT" = pull_request ] && [ "${{ github.event.pull_request.head.repo.fork }}" != "true" ]; then
For more context, check the rskj pr here