Skip to content

Commit

Permalink
Merge pull request #51 from Achintha444/main
Browse files Browse the repository at this point in the history
chore(build): fix PR builder issue
  • Loading branch information
Achintha444 authored Aug 20, 2024
2 parents 9c219e1 + 44c686f commit bc422f8
Showing 1 changed file with 47 additions and 48 deletions.
95 changes: 47 additions & 48 deletions .github/workflows/pr-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -47,51 +46,53 @@ 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:
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
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
- 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
Expand All @@ -103,7 +104,6 @@ jobs:
id: checkout
uses: actions/checkout@v3
with:
token: ${{ env.GH_TOKEN }}
fetch-depth: 0

- name: ☕️ Set up Adopt JDK 17
Expand All @@ -129,7 +129,6 @@ jobs:
id: checkout
uses: actions/checkout@v3
with:
token: ${{ env.GH_TOKEN }}
fetch-depth: 0

- name: 🟢 Setup node
Expand Down

0 comments on commit bc422f8

Please sign in to comment.