Skip to content

Merge pull request #11 from i-Cell-Mobilsoft-Open-Source/foundation #7

Merge pull request #11 from i-Cell-Mobilsoft-Open-Source/foundation

Merge pull request #11 from i-Cell-Mobilsoft-Open-Source/foundation #7

Workflow file for this run

name: Sync Repos
on:
push:
branches:
- main
paths:
- 'tokens/**'
- '!.github/workflows/**'
env:
GIT_PAT: ${{ secrets.GIT_PAT }}
jobs:
sync-repo:
runs-on: ubuntu-latest
strategy:
matrix:
repo: [ids-core-web, ids-core-android, ids-core-ios]
name: Sync ${{ matrix.repo }} Repository
steps:
- name: Checkout core-foundation repository
uses: actions/checkout@v4
with:
repository: i-Cell-Mobilsoft-Open-Source/ids-core-foundation
ref: main
fetch-depth: 0
- name: Set up Git authentication for target repository
run: |
git config --global user.name "icellmobilsoft-robot"
git config --global user.email "[email protected]"
git clone https://x-access-token:[email protected]/i-Cell-Mobilsoft-Open-Source/${{ matrix.repo }}.git
- name: Merge core-foundation tokens into target main
run: |
cd ${{ matrix.repo }}
# Fetch changes from target main
git checkout main
git pull origin main
# Add core-foundation as a remote and fetch its changes
git remote add foundation https://x-access-token:[email protected]/i-Cell-Mobilsoft-Open-Source/ids-core-foundation.git
git fetch foundation
# Create a temporary branch to perform the merge
git checkout -b temp-merge
# Merge only the tokens directory from core-foundation/main
git checkout foundation/main -- tokens
# Stage the changes
git add tokens
# Commit the changes
git commit -m "Merged tokens directory from core-foundation into core-web"
# Checkout main branch and merge the temporary branch
git checkout main
git merge temp-merge
# Push the merged changes back to target main
git push origin main
# Clean up the temporary branch
git branch -d temp-merge