From 4de376fdbd3f02895aa7b27206f6812f7cdebfca Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Tue, 20 Aug 2024 17:52:11 +0530 Subject: [PATCH 1/3] chore(build): fix PR builder issue --- .github/workflows/pr-builder.yml | 90 ++++++++++++++++---------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/.github/workflows/pr-builder.yml b/.github/workflows/pr-builder.yml index 7e95ca9..841a298 100644 --- a/.github/workflows/pr-builder.yml +++ b/.github/workflows/pr-builder.yml @@ -47,51 +47,51 @@ jobs: android_changed: ${{ steps.check_android_changes.outputs.android_changed }} documentation_changed: ${{ steps.check_documentation_changes.outputs.documentation_changed }} steps: - - name: ⬇️ Checkout - uses: actions/checkout@v3 - with: - token: ${{ env.GH_TOKEN }} - fetch-depth: 0 - - - name: 🌴 Fetch PR branch - run: | - if [ ${{ github.event.pull_request.head.repo.fork }} == true ]; then - git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} - else - git fetch origin ${{ github.head_ref }} - fi - - - name: 🗃️ Get changed files - id: changed-files - run: | - if [ ${{ github.event.pull_request.head.repo.fork }} == true ]; then - echo "Comparing changes for PR from fork" - git diff --name-only origin/${{ github.base_ref }}..pr-${{ github.event.pull_request.number }} > changed_files.txt - fi - echo "Changed files:" - cat changed_files.txt - - - name: 🤖 Check for Android Changes - id: check_android_changes - run: | - echo "Checking for Android changes" - android_changed=false - if grep -q "android/" changed_files.txt; then - android_changed=true - echo "Android changes detected" - fi - echo "android_changed=${android_changed}" >> $GITHUB_OUTPUT - - - name: 📑 Check for Documentation Changes - id: check_documentation_changes - run: | - echo "Checking for Documentation changes" - documentation_changed=false - if grep -q "docs/" changed_files.txt; then - documentation_changed=true - echo "Documentation changes detected" - fi - echo "documentation_changed=${documentation_changed}" >> $GITHUB_OUTPUT + - name: ⬇️ Checkout + uses: actions/checkout@v3 + with: + token: ${{ env.GH_TOKEN }} + fetch-depth: 0 + + - name: 🌴 Fetch PR branch + run: | + if [ ${{ github.event.pull_request.head.repo.fork }} == true ]; then + git fetch origin pull/${{ github.event.pull_request.number }}/head:pr-${{ github.event.pull_request.number }} + else + git fetch origin ${{ github.head_ref }} + fi + + - name: 🗃️ Get changed files + id: changed-files + run: | + if [ ${{ github.event.pull_request.head.repo.fork }} == true ]; then + echo "Comparing changes for PR from fork" + git diff --name-only origin/${{ github.base_ref }}..pr-${{ github.event.pull_request.number }} > changed_files.txt + fi + echo "Changed files:" + cat changed_files.txt + + - name: 🤖 Check for Android Changes + id: check_android_changes + run: | + echo "Checking for Android changes" + android_changed=false + if grep -q "android/" changed_files.txt; then + android_changed=true + echo "Android changes detected" + fi + echo "android_changed=${android_changed}" >> $GITHUB_OUTPUT + + - name: 📑 Check for Documentation Changes + id: check_documentation_changes + run: | + echo "Checking for Documentation changes" + documentation_changed=false + if grep -q "docs/" changed_files.txt; then + documentation_changed=true + echo "Documentation changes detected" + fi + echo "documentation_changed=${documentation_changed}" >> $GITHUB_OUTPUT asgardeo-android-sdk-builder: name: 🤖 🚧 Asgardeo Android SDK Builder From f34a69f19df57a2b666729bb0be384e2f8409a23 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Tue, 20 Aug 2024 18:09:08 +0530 Subject: [PATCH 2/3] chore(build): fix PR builder issue --- .github/workflows/pr-builder.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr-builder.yml b/.github/workflows/pr-builder.yml index 841a298..0099f19 100644 --- a/.github/workflows/pr-builder.yml +++ b/.github/workflows/pr-builder.yml @@ -34,7 +34,6 @@ concurrency: cancel-in-progress: true env: - GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN }} ANDROID_SCRIPT_DIR: .github/workflows/scripts/android DOCS_SCRIPT_DIR: .github/workflows/scripts/docs DOC_DIR: docs @@ -50,7 +49,6 @@ jobs: - name: ⬇️ Checkout uses: actions/checkout@v3 with: - token: ${{ env.GH_TOKEN }} fetch-depth: 0 - name: 🌴 Fetch PR branch From 44c686f55a0a2f99bd2fab96282df67723edc2f7 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Tue, 20 Aug 2024 18:14:53 +0530 Subject: [PATCH 3/3] chore(build): fix PR builder issue --- .github/workflows/pr-builder.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-builder.yml b/.github/workflows/pr-builder.yml index 0099f19..01e5582 100644 --- a/.github/workflows/pr-builder.yml +++ b/.github/workflows/pr-builder.yml @@ -65,6 +65,9 @@ jobs: if [ ${{ github.event.pull_request.head.repo.fork }} == true ]; then echo "Comparing changes for PR from fork" git diff --name-only origin/${{ github.base_ref }}..pr-${{ github.event.pull_request.number }} > changed_files.txt + else + echo "Comparing changes for internal PR" + git diff --name-only origin/${{ github.base_ref }}..origin/${{ github.head_ref }} > changed_files.txt fi echo "Changed files:" cat changed_files.txt @@ -101,7 +104,6 @@ jobs: id: checkout uses: actions/checkout@v3 with: - token: ${{ env.GH_TOKEN }} fetch-depth: 0 - name: ☕️ Set up Adopt JDK 17 @@ -127,7 +129,6 @@ jobs: id: checkout uses: actions/checkout@v3 with: - token: ${{ env.GH_TOKEN }} fetch-depth: 0 - name: 🟢 Setup node