Open cryptobench opened 2 years ago
You need to add a schedule trigger, next to pull_request:
, e.g.
schedule:
# https://crontab.guru/every-hour
- cron: '0 * * * *'
Hi Gregor;
I have been trying to use the action merge-schedule-action@v2 for a while but I just cannot get how it works. I got it to work a few times but others it does not work. I am testing changing the date and using the different file actions I have found.
Questions:
name: Merge Schedule
on:
pull_request:
types:
- opened
- edited
- synchronize
schedule:
# https://crontab.guru/every-minute
- cron: '35 7 1 7 *'
jobs:
merge_schedule:
runs-on: ubuntu-latest
steps:
- uses: gr2m/merge-schedule-action@v2
with:
# Merge method to use. Possible values are merge, squash or
# rebase. Default is merge.
merge_method: squash
# Time zone to use. Default is UTC.
time_zone: 'Europe/Berlin'
# Require all pull request statuses to be successful before
# merging. Default is `false`.
require_statuses_success: 'true'
# Label to apply to the pull request if the merge fails. Default is
# `automerge-fail`.
automerge_fail_label: 'merge-schedule-failed'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
I tried to first make different test, read the previous issues, change dates, but I am still having troubles. Hope you have some time to help me. Thank you in advance.
If needed, see: https://github.com/yurith-rubio/Devotify/blob/pr-2/.github/workflows/merge-scheduled.yml
- For this to work, should I ONLY add the file merge-schedule-action@v2 inside .github/workflows folders on my project files? or should I also add the other files you have on the zip file with the latest version (e.g. package.json).
correct
- Is this code correct? with the message on the description of the pull request: '/schedule'. If yes, what am I doing wrong?
This doesn't look right
# https://crontab.guru/every-minute
- cron: '35 7 1 7 *'
When you paste 35 7 1 7 *
into https://crontab.guru you will get an explanation what it means, in this case:
At 07:35 on day-of-month 1 in July
Every minute would be this
# https://crontab.guru/every-minute
- cron: '* * * * *'
However, note that GitHub won't run your action every minute, even when you set the schedule like this. And each time it runs it will take up some of your action minutes, you will have free minutes if the repository is free, but eventually you will run out of it. I'd suggest to not go below every 30 minutes, like so
# https://crontab.guru/every-30-minutes
- cron: '*/30 * * * *'
Note that the # ...
line is just a comment, it's only the help explain the line below. The line that matters is - cron: '...'
.
Hope that helps
Sorry to hijack, but just want to make sure I understand.
The schedule needs to be defined, and if I set a very specific time in the PR using /schedule YYYY-MM-DD:HH:MM:SS
, it won't run at that specific time (unless the cron matched it exactly), but at the next time the schedule is triggered (catching up any that might have been scheduled between schedule runs?
correct.
It might be worth to make it more clear how this action works in the README? PRs welcome
I am trying with the following (which is really almost a copy paste from the Readme): https://github.com/kstatelibrariesit/status.its.lib.k-state.edu/blob/main/.github/workflows/merge-schedule.yml
However, it doesn't seem to get scheduled or merged? Am I missing a step to have it recognize the schedule command in https://github.com/kstatelibrariesit/status.its.lib.k-state.edu/pull/4#issuecomment-1195620471 ?
Thanks!
PR is not merging at all
?
does it work on private repo
all checks are passing but, merge is not being performed
is it because of I'm not using v2 ?
Same issue I am encountering and PR is not being merged automatically
Same issue, waited 2 hours after scheduled time but PR never merged. Does the workflow have to be in main branch already?
# https://github.com/marketplace/actions/merge-schedule
# https://github.com/gr2m/merge-schedule-action
name: Merge Schedule
on:
pull_request:
types:
- opened
- edited
- synchronize
schedule:
# https://crontab.guru/every-hour
- cron: "0 * * * *"
jobs:
merge_schedule:
runs-on: ubuntu-latest
steps:
- uses: gr2m/merge-schedule-action@v2
with:
# Merge method to use. Possible values are merge, squash or
# rebase. Default is merge.
merge_method: squash
# Time zone to use. Default is UTC.
# time_zone: 'America/Los_Angeles'
# Require all pull request statuses to be successful before
# merging. Default is `false`.
require_statuses_success: "true"
# Label to apply to the pull request if the merge fails. Default is
# `automerge-fail`.
automerge_fail_label: "merge-schedule-failed"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@gr2m I found incorrect handling of state
in method getCommitStatusesStatus.
If you look at documentation of this endpoint there is information about pending
status:
pending if there are no statuses or a context is pending
So if total_count
is 0, success
status should be returned.
I could see a racing condition problem where a status is not yet set by your CI. Any thoughts?
Happy to accept a pull request to account for that behavior and just see how it goes for folks
I'm having the same issue.
For the moment, only /schedule
(without date) is working for me.
I believe I am having the same issue. The job comments in my PR that it's scheduled and my cron is set to every minute (self-hosted runners), however it just never does anything. I never see this happen The action sets a pending commit status if the pull request was recognized as being scheduled.
Any ideas @gr2m ?
still not working, am i miss something ?
Hi! First time trying this wonderful extension.
I've added /schedule 2022-06-15T15:43:50+0200 to my PR, and it seems that the extension understood it , but it has not merged it yet. What am I doing wrong?
Here's my workflow: