https://github.com/ttionya/repository-sync-hub-test
Test repository for GitHub Actions "Repository Sync Hub"
https://github.com/ttionya/repository-sync-hub-test
Last synced: about 1 month ago
JSON representation
Test repository for GitHub Actions "Repository Sync Hub"
- Host: GitHub
- URL: https://github.com/ttionya/repository-sync-hub-test
- Owner: ttionya
- License: mit
- Created: 2020-06-02T07:54:59.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-22T18:29:35.000Z (about 3 years ago)
- Last Synced: 2025-06-15T17:07:52.811Z (4 months ago)
- Language: Shell
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Repository Sync Hub
 [](https://github.com/ttionya/Repository-Sync-Hub/blob/master/LICENSE)
A GitHub Actions for sync current repository to other hub.
## Features
- Sync branches and tags to other repository (GitHub, GitLab, Gitee, etc.)
- Target repository support SSH and HTTP URL
- Automatic delete branches and tags that is deleted
- Retry on network errors
- Can triggered on `PUSH` and `DELETE` event
- Can triggered on a timer (`SCHEDULE`)
## Usage
Be sure to run the [actions/checkout](https://github.com/actions/checkout) in a step before this action.
### SSH URL
```yml
# File .github/workflows/sync-ssh.ymlsteps:
-
name: Checkout
uses: actions/checkout@v3
with:
# Must be specified as 0, otherwise git does not allow push because of shallow updates.
fetch-depth: 0
-
name: Sync
uses: ttionya/Repository-Sync-Hub@v1
with:
# Sync to target repository full clone URL.
target_repository: 'git@github.com:ttionya/Repository-Sync-Hub-Test.git'
# SSH key used to authenticate with git operations.
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
```### HTTP URL
```yml
# File .github/workflows/sync-http.ymlsteps:
-
name: Checkout
uses: actions/checkout@v3
with:
# Must be specified as 0, otherwise git does not allow push because of shallow updates.
fetch-depth: 0
# Be sure use your own access token when you want to sync to GitHub repository,
# only HTTP URL need this.
token: ${{ secrets.HTTP_ACCESS_TOKEN }}
-
name: Sync
uses: ttionya/Repository-Sync-Hub@v1
with:
# Sync to target repository full clone URL.
target_repository: 'https://github.com/ttionya/Repository-Sync-Hub-Test.git'
# Login name used to authenticate with git operations.
http_access_name: 'ttionya'
# Personal Access Token (PAT) used to authenticate with git operations.
http_access_token: ${{ secrets.HTTP_ACCESS_TOKEN }}
```**Note:** Access token needs **workflow** access, it will automatically check the full access to the repository.
You can see [sample workflows](/.github/workflows/) for more usages.
## About Dependabot
Dependabot triggered Actions can't access secrets now, you can view details [here](https://github.com/dependabot/dependabot-core/issues/3253#issuecomment-852541544).
## Thanks
Inspired by the following actions which may be more suitable for your workflow.
- [wei/git-sync](https://github.com/wei/git-sync)
- [net-engine/github-repository-sync-action](https://github.com/net-engine/github-repository-sync-action)
## License
MIT