Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stavares843/sync-public-repo-to-private-repo
Github Action to sync a public repo to a private repo
https://github.com/stavares843/sync-public-repo-to-private-repo
github-actions
Last synced: 5 days ago
JSON representation
Github Action to sync a public repo to a private repo
- Host: GitHub
- URL: https://github.com/stavares843/sync-public-repo-to-private-repo
- Owner: stavares843
- License: mit
- Created: 2024-02-03T01:10:26.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-08-18T21:42:48.000Z (5 months ago)
- Last Synced: 2024-11-26T06:08:03.049Z (2 months ago)
- Topics: github-actions
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Github Action to sync a public repo to a private repo
![002](https://github.com/stavares843/sync-public-repo-to-private-repo/assets/29093946/b5ccfa8f-5851-44a5-ae0d-d96f90f5d1f2)
# Description
If you have a public repo and want to test something with the same content on a private repo, you can do a private repo by
- Create a new repo
- Import the repo using the public URL
- You now have a private repo with the same content as the public one, but it's not synced automatically, and it doesn't have a sync button like the forked repos
- Add the above file as a workflow and update it with the correct repo info
- Go to actions, select the action, click on run workflow, and run the action
- When you add a new commit on the public repo, re-running the action will update the branch on the private repo with the latest commit as well
- You can also add a cron job on the action to update automatically instead# Usage
https://github.com/stavares843/sync-public-repo-to-private-repo/assets/29093946/a991ce55-6f4f-4dce-b7b4-4559c37340b0
# Notes
If your repo has a `.workflows` folder you need to add the following to avoid this error
- You need to create a token with `contents:write` and `workflows:write` scopes and add it on the checkout step
```
- name: Check out code
uses: actions/checkout@v4
with:
# Fine-grained PAT with contents:write and workflows:write scopes
token: ${{ secrets.WORKFLOW }}
```