Comments (5)
Yes, that could be a bug. Can you try enabling debug logs as described in https://github.com/pascalgn/automerge-action#debugging and see if that gives any hints/info?
from automerge-action.
We seem to have encountered the same bug. So here is a Trace log output to help you in trouble shooting.
I'm not 100% sure it is the same, but from what I see of the issue description it looks very much the same what happens in our case.
Some details have been removed for security.
There was a lot of it so made a pastebin rather than even try to get it nicely formatted in here
from automerge-action.
I spent a couple of hours last night digging through what is happening. And I belive now that this isn't a bug on your part @pascalgn. When a PR have "Require approvals" enabled it can't be merge through API or otherwise. As seen in your error handling code, that error is already in there. And in the array MAYBE_READY the 'blocked' status isn't in there.
I forked your repo and tried to add 'blocked' to see if there is a way to go around branch protection rules when "Require approvals" is enabled. And there isn't really a good way.
What I can say worked after some research on the topic is that you can have another action first approve the PR. This is however not without risk as laid out here https://medium.com/cider-sec/bypassing-required-reviews-using-github-actions-6e1b29135cc7
So, for any one else stumbling on this and woundering. The solution is:
- to make sure "Allow GitHub Actions reviews to count towards required approval" to be set on the repo.
- have the number of approvals required be 1
- run a auto approve action first, example: https://github.com/hmarr/auto-approve-action and make sure it is only run for PRs you intend to handle automatically
- then lastly run this action on the now approved PR which will then stop being 'blocked' and will enter a state where it can be automerged
I set up a test in my private account where you can see an example solution I made: https://github.com/aiqueneldar/tests/blob/main/.github/workflows/automerge.yml
In conclusion, I think this can be closed. And I hope this will help future people.
from automerge-action.
I close this now, as suggested, even though it wasn't the original author. If you feel this issue is still needed, please let me know!
from automerge-action.
For the googlers: "Allow GitHub Actions reviews to count towards required approval" is in your organizations settings (https://github.com/organizations/ORGNAME/settings/actions) at the very end at "Workflow permissions"
from automerge-action.
Related Issues (20)
- Can't change log level to debug. HOT 2
- Old configuration option present: LABELS HOT 2
- I am coping HOT 5
- What does BASE_BRANCHES do? HOT 2
- UPDATE_RETRY_SLEEP and UPDATE_RETRIES does not respect label HOT 2
- Gotcha for new repos HOT 2
- Missing commit if merge happens right after it HOT 1
- Question: will automerge bypass branch protections? HOT 1
- Merges PRs when mergeable_state = undefined HOT 2
- Failed to merge PR: Changes must be made through the merge queue HOT 2
- ERROR Resource not accessible by integration HOT 5
- bug: Invalid workflow file
- ERROR fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing HOT 1
- Add 'pull-request-title-and-commit-details' option for MERGE_COMMIT_MESSAGE HOT 2
- Append PR number to merge commit message HOT 2
- Questions about the process with error: Old configuration option present: LABELS HOT 1
- Update more than 10 PRs in a run
- PAT not used when merging PRs
- Add MERGE_FILTER_AUTHORS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from automerge-action.