GithubHelp home page GithubHelp logo

tibdex / auto-update Goto Github PK

View Code? Open in Web Editor NEW
60.0 2.0 41.0 405 KB

๐Ÿ”„ Automatically keep pull requests with auto-merge enabled up to date with their base branch

License: MIT License

JavaScript 28.64% TypeScript 71.36%
github-action javascript-github-action auto-update pull-requests auto-merge

auto-update's Introduction

auto-update's People

Contributors

tibdex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

auto-update's Issues

PRs updated via `tibdex/auto-update` don't trigger certain required checks

We have a CI workflow that is triggered by:

on:
  pull_request_target:
    types: [ opened, synchronize, reopened, ready_for_review ]
  push:
    branches:
      - production

We also have a CircleCI workflow configured via the "CircleCI Checks" GitHub app.

If I go into the GitHub web interface and click the "Update Branch" button, all my workflows are triggered. If, instead, I enable Auto-Merge and let tibdex/auto-update trigger the update, only my CircleCI workflow runs. The GitHub actions just show "Expected โ€” Waiting for status to be reported" but never trigger.

Is this something you have run into? Any idea how to get GitHub to trigger my CI workflow when this action triggers an update?

Which permissions are need at the workflow level?

Which permissions are needed at the workflow level?

When i tried to apply these permissions, which seem to cover queries that i can see in src/index.ts:

permissions:
  contents: read
  pull-requests: write

I got this error:

Warning: HttpError: user doesn't have permission to update head repository

And it commented on my PRs that they could not be updated because of conflicts, despite having no conflicts.

Screenshot 2023-03-23 at 19 36 09

Support update method rebase

I couldn't find any documentation on this for the API endpoint but after some research into the requests the UI is making itself it is possible to update PRs with a rebase using the following option:

gh api \
  --method PUT \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  "/repos/$org/$repo/pulls/$pr/update-branch" \
  -f update_method=rebase

Could this be a configurable option?

Auto-update not triggering CI checks

Hi.

I have a GH workflow that runs on the following trigger:

on:
  pull_request:
    types: [opened, synchronize, ready_for_review]

So everytime we push to a PR branch, or click "Update branch" from the PR, it re-runs.

My issue: When auto-update is activated, it updates the branch correctly but no CI check is triggered.

Any idea why?

Ability to queue updates?

Hey there, thanks for building this! It looks like a great alternative to github's merge queue feature, which isn't generally available yet!

I'm thinking about using auto-update to queue up several dependency bump PRs at a time, but I'm concerned that it will update all auto-mergeable PRs each time one is merged, causing undue load on my CI system. Is there a way to queue up the updates so that only the PR for which auto-merge was enabled earliest, gets updated?

If not, I might be willing to add an option for it, if it's possible to tell from the github API the time at which the auto-merge button was clicked.

Thanks!

Ability to add labels to a PR if there is an error

Thanks for your work on this and Autosquash!

Are you open to accepting PRs that would extend this further? My guess is you would rather keep this simple, which is fine. If you are open to updates, I would be interested in adding a label or comment to the PR if there were conflicts. It looks as if we are just returning the warning if there is an error trying to update, so that complicates things having to know what all of the possible responses are that we want to handle commenting or labeling.

Let me know if you would prefer to keep this out of this simple implementation and I can fork your work instead to put something together based on my teams needs.

auto-update confuses dependabot

Hey there :) this is a really awesome action! only issue is that dependabot stops rebasing its PRs if they have any non-dependabot commits. Is it possible to make this exclude some set of authors?

Example:

zemn-me/monorepo#520

Ability to configure to also update PRs in draft status

Currently it appears auto-update will only update PRs that are not in Draft state. It would be nice to be able to configure this.

Like my other feature request, let me know if you are open to accepting PRs. Someone on my team or I would be happy to submit one!

Ability to opt-in to auto-update with a label

Thanks for this neat GH action!


I want to use it on PRs which are not auto_merge.

I'm thinking that this early return:

if (!pullRequest.auto_merge) {

could check if we've opted in via label, like:

!(pullRequest.auto_merge || pullRequest.labels.include?("auto-update:opt-in"))

Any concerns / Would you accept a PR for this?

Thanks

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.