Merge pull request #77 from DguFarmSystem/chore/#71 #25
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 | |
jobs: | |
sync: | |
name: Sync to Forked Repo | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout branch | |
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: Add remote repository | |
run: | | |
git remote add forked-repo https://dewbeeny:${{ secrets.AUTO_ACTIONS }}@github.com/dewbeeny/HomePage-FE | |
git config user.name dewbeeny | |
git config user.email ${{ secrets.EMAIL }} | |
- name: Push changes to forked repo | |
run: | | |
git push -f https://$GITHUB_ACTOR:${{ secrets.AUTO_ACTIONS }}@github.com/DguFarmSystem/HomePage-FE.git ${{ env.TARGET_BRANCH }} | |
- name: Clean up | |
run: | | |
git remote remove forked-repo |