Update mirror.yml #66
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: Mirror Branch to ISYE | |
on: | |
push: | |
branches: | |
- production | |
jobs: | |
mirror: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone CEC repo | |
run: git clone --branch production ${{ github.server_url }}/${{ github.repository }} | |
- name: Add ISYE repo as an upstream remote | |
run: | | |
cd ${{ github.event.repository.name }} | |
git remote add mirror https://${{ vars.ISYE_MIRROR_USER }}:${{ secrets.ISYE_MIRROR_TOKEN }}@${{ vars.ISYE_MIRROR_REPO }} | |
- name: Remove the .github folder to avoid a recursive workflow | |
run: | | |
cd ${{ github.event.repository.name }} | |
rm -rf .github | |
- name: Commit the change | |
run: | | |
cd ${{ github.event.repository.name }} | |
git config --global user.email "" | |
git config --global user.name "GitHub Actions" | |
git commit -a -m "[GitHub Action] Synced with CEC parent repo" | |
- name: Push CEC production branch to ISYE main branch | |
run: | | |
cd ${{ github.event.repository.name }} | |
git push mirror production:main --force |