Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems scheduling git sync #18

Closed
connecteev opened this issue Aug 24, 2020 · 5 comments
Closed

Problems scheduling git sync #18

connecteev opened this issue Aug 24, 2020 · 5 comments

Comments

@connecteev
Copy link

connecteev commented Aug 24, 2020

Hi @wei Thanks for the tips so far. Per your recommendation at repo-sync/github-sync#18 (comment)

I got this sync to work by creating a "taskrunner" repo that syncs from the private source repo to my private destination repo...but it works only when I push changes to the taskrunner repo...even though I have a "every 3 mins" schedule defined below in my yml file.
I saw the same issue with https://github.com/repo-sync/github-sync/ where the schedule does not run (but it does run on push). What am I doing wrong here? Could this be a bug, and does this work for you? Thanks..

# File: .github/workflows/git-sync.yml

name: Git Sync # from https://github.com/wei/git-sync
on:
  push:
  schedule:
  - cron: "*/3 * * * *"  # runs every 3 mins (for now)

jobs:
  git-sync:
    runs-on: ubuntu-latest
    steps:
    - name: git-sync
      uses: wei/git-sync@v2
      with:
        source_repo: "https://connecteev:${{ secrets.MY_PERSONAL_ACCESS_TOKEN_FROM_GITHUB_SETTINGS }}@github.com/xxxxxxxxxx/yyyyyyyyyyy.git"
        source_branch: "refs/remotes/source/*"
        destination_repo: "https://connecteev:${{ secrets.MY_PERSONAL_ACCESS_TOKEN_FROM_GITHUB_SETTINGS }}@github.com/connecteev/yyyyyyyyyyy.git"
        destination_branch: "refs/heads/*"
@wei
Copy link
Owner

wei commented Aug 24, 2020

Cron trigger only works on workflows in the default branch.

@connecteev
Copy link
Author

connecteev commented Aug 24, 2020

Hi @wei
if I use wei/git-sync/ as a taskrunner, the cron should work if I have the yml file in the master (default) branch.

My cron schedule was (and still is) set to run every 3 minutes:

on:
  push:
  schedule:
  - cron: "*/3 * * * *"  # runs every 3 mins (for now)
  • Yesterday when I filed this ticket, the cron was not running (at all).
  • Now, when I came back to check the github action logs, I see the cron running but at arbitrary intervals (screenshot below)...but still not every 3 minutes.

I am not familiar with how github actions work internally - but I am reporting this just in case you know what's going on, or in case there's a potential bug here.

image

@wei
Copy link
Owner

wei commented Aug 24, 2020

You can check github.community

This is a github limitation/bug anything over 15 should work fine.

@Lemmingh
Copy link

@connecteev

https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule

Scheduled workflows run on the latest commit on the default branch.

The shortest interval you can run scheduled workflows is once every 5 minutes.

@connecteev
Copy link
Author

@wei @Lemmingh interesting..I didnt know about the 5 min limitation, maybe that's why the cron was behaving so erratically. Thanks for clarifying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants