feat: Update breadcrumb to use composite component pattern (#464) #83
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sync PR from main into develop | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
sync-develop: | |
name: Create PR from main into develop | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup git | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Create Pull Request if there are changes | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# Fetch the latest main and develop | |
git fetch origin main | |
# Get the latest commit message and hash | |
git checkout main | |
COMMIT_HASH=$(git rev-parse HEAD) | |
COMMIT_MSG=$(git log -1 --pretty=%B) | |
# Check if there are any differences between main and develop | |
if git diff --quiet main origin/develop; then | |
echo "[SKIPPED] No changes to sync - develop is already up to date with main" | |
exit 0 | |
fi | |
# Create a new branch from main | |
SYNC_BRANCH="sync/main-to-develop-${COMMIT_HASH:0:7}" | |
git checkout -b $SYNC_BRANCH | |
git push origin $SYNC_BRANCH | |
# Create PR from main into develop | |
gh pr create \ | |
--base develop \ | |
--head $SYNC_BRANCH \ | |
--title "chore: sync main into develop (${COMMIT_HASH:0:7})" \ | |
--body "This PR is automatically created to sync changes from main into develop. | |
**Note:** This PR must be merged using 'Create a merge commit' option only. | |
**Changes included:** | |
${COMMIT_MSG} | |
This PR was triggered by commit: ${COMMIT_HASH}" \ | |
--label "automated-sync" \ | |
--assignee "paanSinghCoder" || echo "PR creation failed, likely because PR already exists" |