Merge pull request #78 from DguFarmSystem/chore/#71 #26
This file contains 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: Synchronize to Forked Repo | |
on: | |
push: | |
branches: | |
- develop | |
- main | |
repository_dispatch: # 원본 레포에서 이벤트 발생 시 실행되도록 설정 | |
types: [sync-fork] | |
jobs: | |
sync: | |
name: Sync to Forked Repo | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout forked repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.AUTO_ACTIONS }} | |
fetch-depth: 0 | |
- name: Determine target branch | |
id: vars | |
run: | | |
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then | |
echo "TARGET_BRANCH=develop" >> $GITHUB_ENV | |
else | |
echo "TARGET_BRANCH=main" >> $GITHUB_ENV | |
fi | |
- name: Configure Git | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
- name: Add upstream repository (original repo) | |
run: | | |
git remote add upstream https://github.com/DguFarmSystem/HomePage-FE.git | |
git fetch upstream | |
- name: Merge upstream changes into forked repo | |
run: | | |
git checkout ${{ env.TARGET_BRANCH }} | |
git merge --no-edit upstream/${{ env.TARGET_BRANCH }} | |
git push origin ${{ env.TARGET_BRANCH }} |