Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): fix PR builder issue #51

Merged
merged 3 commits into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading