⤵️ A GitHub Action for syncing current repository with remote
<!-- ALL-CONTRIBUTORS-BADGE:END -->
A GitHub Action for syncing the current repository using force push.
Create a personal access token and add to repository's secret as
PAT
# File: .github/workflows/repo-sync.ymlon: schedule:
jobs: repo-sync: runs-on: ubuntu-latest steps: - uses: actions/[email protected] with: persist-credentials: false - name: repo-sync uses: repo-sync/[email protected] with: source_repo: "" source_branch: "" destination_branch: "" github_token: ${{ secrets.PAT }}
If
source_repois private or with another provider, either (1) use an authenticated HTTPS repo clone url like
https://${access_token}@github.com/owner/repository.gitor (2) set a
SSH_PRIVATE_KEYsecret environment variable and use the SSH clone url
*for both
source_branchand
destination_branch
with: sync_tags: "true"This will force sync ALL branches to match source repo. Branches that are created only in the destination repo will not be affected but all the other branches will be hard reset to match source repo. ⚠️ This does mean if upstream ever creates a branch that shares the name, your changes will be gone.
Thanks goes to these wonderful people (emoji key):
Wei He 💻 📖 🎨 🤔 |
Zeke Sikelianos 📖 🤔 |
Alex Page 🐛 |
xtqqczze 💻 📖 |
Kay Harrison-Sims 🐛 |
Gibby 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!