From dc060e02bd11848ee667f81fa1f2e7fe3bbc4e2d Mon Sep 17 00:00:00 2001 From: Reynold Morel Date: Mon, 30 Sep 2024 10:33:22 -0400 Subject: [PATCH 1/4] Skipping SonarQube analysis on fork repos --- .github/workflows/build_and_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index dbfec017604..1167b72a40d 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -105,7 +105,7 @@ jobs: GH_REF: ${{ github.ref }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | - if [ "$GH_EVENT" = pull_request ]; then + if [ "$GH_EVENT" = pull_request ] && [ "${{ github.event.pull_request.head.repo.fork }}" != "true" ]; then ./gradlew -Dorg.gradle.jvmargs=-Xmx5g sonarqube --no-daemon -x build -x test \ -Dsonar.pullrequest.base="$GH_PR_BASE_REF" \ -Dsonar.pullrequest.branch="$GH_PR_HEAD_REF" \ From 8f53b4cd33d5fba03167865733734283992a9d01 Mon Sep 17 00:00:00 2001 From: Reynold Morel Date: Mon, 30 Sep 2024 10:35:16 -0400 Subject: [PATCH 2/4] Adding REPO_OWNER env variable --- .github/workflows/rit.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/rit.yml b/.github/workflows/rit.yml index 9fac1b2cf9d..3daa9a81c74 100644 --- a/.github/workflows/rit.yml +++ b/.github/workflows/rit.yml @@ -96,6 +96,14 @@ jobs: exit 1 fi + # Set the Repo Owner + if [ -n "${{ github.event.pull_request.head.repo.owner.login }}" ]; then + REPO_OWNER=${{ github.event.pull_request.head.repo.owner.login }} + else + REPO_OWNER=${{ github.repository_owner }} + fi + + echo "REPO_OWNER=$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 @@ -121,6 +129,7 @@ jobs: rskj-branch: ${{ env.RSKJ_BRANCH }} powpeg-node-branch: ${{ env.POWPEG_BRANCH }} rit-branch: ${{ env.RIT_BRANCH }} + repo-owner: ${{ env.REPO_OWNER }} - name: Send Slack Notification on Success if: success() && github.event.pull_request.head.repo.owner.login == 'rsksmart' From 2f64677e238453f46245c4348a1839be4d385973 Mon Sep 17 00:00:00 2001 From: Reynold Morel Date: Wed, 2 Oct 2024 10:10:46 -0400 Subject: [PATCH 3/4] addressing comments --- .github/workflows/rit.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rit.yml b/.github/workflows/rit.yml index 3daa9a81c74..c7ca53999dd 100644 --- a/.github/workflows/rit.yml +++ b/.github/workflows/rit.yml @@ -36,6 +36,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 @@ -97,11 +99,8 @@ jobs: fi # Set the Repo Owner - if [ -n "${{ github.event.pull_request.head.repo.owner.login }}" ]; then - REPO_OWNER=${{ github.event.pull_request.head.repo.owner.login }} - else - REPO_OWNER=${{ github.repository_owner }} - fi + REPO_OWNER="${github_event_pull_request_head_repo_owner_login:-$github_repository_owner}" + echo "REPO_OWNER=$REPO_OWNER" >> $GITHUB_ENV echo "RSKJ_BRANCH=$RSKJ_BRANCH" >> $GITHUB_ENV From 9f433cf2568ef68550ecff9a77f7ee4056117471 Mon Sep 17 00:00:00 2001 From: Reynold Morel Date: Fri, 11 Oct 2024 10:35:04 -0400 Subject: [PATCH 4/4] Updating rit tag --- .github/workflows/rit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rit.yml b/.github/workflows/rit.yml index c7ca53999dd..b5d76120548 100644 --- a/.github/workflows/rit.yml +++ b/.github/workflows/rit.yml @@ -123,7 +123,7 @@ jobs: echo "SAFE_BRANCH_NAME=$SAFE_BRANCH_NAME" >> $GITHUB_ENV - name: Run Rootstock Integration Tests - uses: rsksmart/rootstock-integration-tests@497172fd38dcfaf48c77f9bb1eeb6617eef5eed6 #v1 + uses: rsksmart/rootstock-integration-tests@e86332474179a63f027d0fe969687d3d24f34c29 #v1 with: rskj-branch: ${{ env.RSKJ_BRANCH }} powpeg-node-branch: ${{ env.POWPEG_BRANCH }}