Skip to content

Commit

Permalink
Skipping SonarQube analysis on fork repos and adding POWPEG_REPO_OWNE…
Browse files Browse the repository at this point in the history
…R input
  • Loading branch information
rmoreliovlabs committed Oct 3, 2024
1 parent 1a0e26a commit 05c139a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
chmod +x gradlew
if [ "$GH_EVENT" = pull_request ]; then
if [ "$GH_EVENT" = pull_request ] && [ "${{ github.event.pull_request.head.repo.fork }}" != "true" ]; then
./gradlew sonarqube --warning-mode all --no-daemon --stacktrace --info -x build -x test \
-Dsonar.pullrequest.base="$GH_PR_BASE_REF" \
-Dsonar.pullrequest.branch="$GH_PR_HEAD_REF" \
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/rit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
github_event_pull_request_number: ${{ github.event.pull_request.number }}
github_head_ref: ${{ github.head_ref }}
github_ref_name: ${{ github.ref_name }}
github_event_pull_request_head_repo_owner_login: ${{ github.event.pull_request.head.repo.owner.login }}
github_repository_owner: ${{ github.repository_owner }}
run: |
PR_DESCRIPTION=pr-description.txt
Expand Down Expand Up @@ -94,6 +96,10 @@ jobs:
exit 1
fi
# Set the Repo Owner
POWPEG_REPO_OWNER="${github_event_pull_request_head_repo_owner_login:-$github_repository_owner}"
echo "POWPEG_REPO_OWNER=$POWPEG_REPO_OWNER" >> $GITHUB_ENV
echo "RSKJ_BRANCH=$RSKJ_BRANCH" >> $GITHUB_ENV
echo "RIT_BRANCH=$RIT_BRANCH" >> $GITHUB_ENV
echo "POWPEG_BRANCH=$POWPEG_BRANCH" >> $GITHUB_ENV
Expand All @@ -119,6 +125,7 @@ jobs:
rskj-branch: ${{ env.RSKJ_BRANCH }}
powpeg-node-branch: ${{ env.POWPEG_BRANCH }}
rit-branch: ${{ env.RIT_BRANCH }}
powpeg-repo-owner: ${{ env.POWPEG_REPO_OWNER }}

- name: Send Slack Notification on Success
if: success() && github.event.pull_request.head.repo.owner.login == 'rsksmart'
Expand Down

0 comments on commit 05c139a

Please sign in to comment.