delete prod branch from remote #34
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: Checkout CEC repository | |
uses: actions/checkout@v3 | |
- name: Add the ISYE repository as a mirror | |
run: | | |
git remote add mirror https://jkolb6:${{ secrets.ISYE_MIRROR_TOKEN }}@github.gatech.edu/isye-web/tmm_hai_cec | |
- name: Update CEC repository | |
run: | | |
git switch production | |
git fetch --force origin | |
git pull | |
- name: Delete the production branch from ISYE | |
run: | | |
git push mirror --delete production --force | |
- name: Remove the .github folder to avoid a recursive workflow | |
run: rm -rf .github | |
- name: Commit the change | |
run: | | |
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 to the ISYE main branch | |
run: git push mirror production --force |