Giter VIP home page Giter VIP logo

Comments (7)

alfieyfc avatar alfieyfc commented on June 19, 2024 1

someone who does not have write permissions to the repository

I misread this bit of context! It's not acting as I was expecting because I am the repo owner. @peter-evans Thanks for the clarification!

Though having a disable option could be handy, for now I'm accepting it as a limitation where maintainers have to manually disable automerge when they make changes themselves. To me this issue can be considered resolved then. But I'll leave it for you to close in case you wanna decide if mutation for disable is worth your time implementing. :)

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on June 19, 2024

@alfieyfc The documentation suggests that it is automatically disabled when the base of the PR is changed. I don't think you need to explicitly disable it in a workflow.

After you enable auto-merge for a pull request, if someone who does not have write permissions to the repository pushes new changes to the head branch or switches the base branch of the pull request, auto-merge will be disabled. For example, if a maintainer enables auto-merge for a pull request from a fork, auto-merge will be disabled after a contributor pushes new changes to the pull request.

ref: https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/automatically-merging-a-pull-request

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on June 19, 2024

There is a GraphQL mutation for disable, though. So if for some reason the automated disable outlined in the documentation doesn't work for your use case I think I can add it to the action.

https://docs.github.com/en/graphql/reference/mutations#disablepullrequestautomerge

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on June 19, 2024

I'll close it for now then. It can always be reopened if there is a need for it in future.

from enable-pull-request-automerge.

alfieyfc avatar alfieyfc commented on June 19, 2024

@peter-evans Hello there 👋 I'm back thinking of reopening this feature request since auto_merge_enabled had become a pull_request event type.

The scenario would be someone carelessly enabling auto-merge for a PR that has a base branch we don't want to allow auto-merging. So the action would quickly check if base branch is valid for auto-merge. Then, if not, the action will disable it.

I tried searching for other actions that can disable auto-merge but didn't find anything suitable. Any suggestions?

from enable-pull-request-automerge.

peter-evans avatar peter-evans commented on June 19, 2024

After thinking a bit more about this, I'm not sure that adding it to this action makes sense since "enable" is in the title of the action.

I would recommend using github-script to call the disable API. The query should look very similar to the code I have here to enable.

from enable-pull-request-automerge.

alfieyfc avatar alfieyfc commented on June 19, 2024

@peter-evans Makes sense! I'll try to set it up for my workflow. Thanks for the reply! 🙏

from enable-pull-request-automerge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.