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

PR not merged ? #66

Open
cryptobench opened this issue Jun 15, 2022 · 15 comments
Open

PR not merged ? #66

cryptobench opened this issue Jun 15, 2022 · 15 comments
Labels
question Further information is requested

Comments

@cryptobench
Copy link

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?

image

Here's my workflow:

name: Merge Schedule

on:
  pull_request:
    types:
      - opened
      - edited
      - synchronize

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: merge
        env:
          GITHUB_TOKEN: ${{ secrets.PAT }}
@gr2m
Copy link
Owner

gr2m commented Jun 16, 2022

You need to add a schedule trigger, next to pull_request:, e.g.

  schedule:
    # https://crontab.guru/every-hour
    - cron: '0 * * * *'

See https://github.com/gr2m/merge-schedule-action/#usage

@ruisaraiva19 ruisaraiva19 added the question Further information is requested label Jun 22, 2022
@yurith-rubio
Copy link

yurith-rubio commented Jul 1, 2022

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:

  1. 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).
  2. Is this code correct? with the message on the description of the pull request: '/schedule'. If yes, what am I doing wrong?
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

@gr2m
Copy link
Owner

gr2m commented Jul 1, 2022

  • 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

@misilot
Copy link

misilot commented Jul 21, 2022

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?

@gr2m
Copy link
Owner

gr2m commented Jul 21, 2022

correct.

@gr2m
Copy link
Owner

gr2m commented Jul 21, 2022

It might be worth to make it more clear how this action works in the README? PRs welcome

@misilot
Copy link

misilot commented Jul 26, 2022

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 kstatelibraries/status.its.lib.k-state.edu#4 (comment) ?

Thanks!

@codeArtisanry
Copy link

Screenshot_2022-07-28-08-06-42-95_40deb401b9ffe8e1df2f1cc5ba480b12.jpg

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 ?

@rizypb
Copy link

rizypb commented Aug 12, 2022

Same issue I am encountering and PR is not being merged automatically

@ConorSheehan1
Copy link

Same issue, waited 2 hours after scheduled time but PR never merged. Does the workflow have to be in main branch already?

Screenshot_20220904-200817

# 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 }}

@jakubpradzynski
Copy link

@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.

@gr2m
Copy link
Owner

gr2m commented Oct 10, 2022

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

@maikol-solis
Copy link

I'm having the same issue.
For the moment, only /schedule (without date) is working for me.

@cogito-cmurphy
Copy link

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 ?

@tanapatMintel
Copy link

still not working, am i miss something ?

Screen Shot 2566-08-10 at 15 16 57 Screen Shot 2566-08-10 at 15 18 02

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

No branches or pull requests