.github/workflows/repository-synchronisation.yml #30905
This file contains hidden or 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
# checkout@v3: checks-out/downloads your repository under $GITHUB_WORKSPACE with fetch-depth: 1, so your workflow can access it. | |
on: | |
schedule: | |
- cron: '*/15 * * * *' | |
workflow_dispatch: | |
jobs: | |
git-sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: git-sync | |
uses: wei/git-sync@v3 | |
with: | |
source_repo: "https://repo.or.cz/tinycc.git" | |
source_branch: "mob" | |
destination_repo: "[email protected]:Tiny-C-Compiler/mirror-repository" | |
destination_branch: "mob" | |
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} # Since we upload to the other organisation's mirror-repository, we need to use SSH keys to gain the other organisational repository's access. | |
# Regular Github token only gives access to the current repository. | |
# If you see "bad credentials" when running this workflow, it just means that deployment SSH Public key is for some reason not added, got deleted or otherwise gone on the mirror-repository | |
# Or the our GitHub-Actions-mirror-repository secret: SSH_PRIVATE_KEY does not match deployment SSH Public key of mirror-repository. | |
# Look at visual tutorial to resolve "bad credentials" https://github.com/Tiny-C-Compiler/GitHub-Actions-mirror-repository?tab=readme-ov-file#visual-tutorial-for-actions-repository-to-gain-access-to-mirror-repository | |
workflow-keepalive: | |
if: github.event_name == 'schedule' | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
steps: | |
- uses: liskin/gh-workflow-keepalive@v1 |