GithubHelp home page GithubHelp logo

depandabot / conflict-bot Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 5.0 32 KB

Github action for tracking conflicts between open pull requests

License: MIT License

JavaScript 100.00%
action bot conflict pull-request

conflict-bot's Introduction

ConflictBot: Your PR Conflict Detector

ConflictBot is a GitHub Action designed to help maintain a smooth and efficient code integration process within your repository. Whenever a new pull request is opened, ConflictBot jumps into action to check if the lines of files changed in the new pull request correspond with lines changed in other open pull requests. If a conflict is detected, the bot helps foster collaboration by creating a comment on the pull request, referencing the conflicting lines, authors, and PR numbers, and suggesting the authors to review each other's changes.

Getting Started

Pre-requisites

A GitHub repository where you intend to use ConflictBot.

Necessary permissions to add a GitHub Action to the repository.

A fine-grained GitHub access token with the following permissions:

  • Actions (read-only)
  • Commit statuses (read-only)
  • Contents (read-only)
  • Metadata (read-only)
  • Pull Requests (read and write)

Setting Up

Create a Personal Access Token: Generate a personal access token with the necessary permissions to enable ConflictBot to interact with your repository.

Save the access token in your Actions Repository Secrets under the name CONFLICT_BOT_ACCESS_TOKEN.

Add the Action to Your Repository: Create a new workflow file (.yml) in the .github/workflows directory of your repository and add the configuration for ConflictBot.

Here is a basic setup for your GitHub Action workflow:
name: PR Conflict Checker

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  check_pr_conflicts:
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@v2

      - name: Run PR Conflict Checker
        uses: ConflictBot/ConflictBot@v1
        with:
          github-token: ${{ secrets.CONFLICT_BOT_ACCESS_TOKEN }}
          main-branch: main
          quiet: true

Contributing

ConflictBot is open-source and we welcome contributions. If you'd like to contribute, please fork the repository and make your changes, then open a pull request against the main branch.

We hope ConflictBot helps maintain a smooth and efficient code integration process in your repository. If you have any questions or need further assistance, feel free to open an issue in the repository.

Happy Coding!

conflict-bot's People

Contributors

azanli avatar

Stargazers

 avatar

Watchers

 avatar

conflict-bot's Issues

Cannot run conflict-bot

I tested this out with a PR on one of my projects and got this error:

node:internal/modules/cjs/loader:1031
  throw err;
  ^

Error: Cannot find module '@actions/core'
Require stack:
- /home/runner/work/_actions/depandabot/conflict-bot/v1/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1028:15)
    at Function.Module._load (node:internal/modules/cjs/loader:873:27)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/home/runner/work/_actions/depandabot/conflict-bot/v1/index.js:1:14)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:107[6](https://github.com/houseabsolute/precious/actions/runs/6669165413/job/18126338149#step:3:7):32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:[8](https://github.com/houseabsolute/precious/actions/runs/6669165413/job/18126338149#step:3:9)1:[12](https://github.com/houseabsolute/precious/actions/runs/6669165413/job/18126338149#step:3:13)) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/runner/work/_actions/depandabot/conflict-bot/v1/index.js' ]
}```

The full logs are at https://github.com/houseabsolute/precious/actions/runs/6669165413/job/18126338149

Warning level for file collisions

Hi,

I am currently in Merge Purgatory and was looking around for tools like this one.

It looks like this detects line-level collisions only?

Since this is intended as an "early warning system", it might be a good idea to also warn people of file-level collisions - these are much more likely to occur, but lines colliding does not necessarily happen, even in files that end up being unmergeable. It's entirely possible to have no merge conflicts, and still end up with code that makes no sense.

What I'd want from a script like this, is the opportunity to know it before I'm stepping on another team member's toes - if we're both working on the same files, it's not unlikely we'll end up with a conflict soon, and this should prompt us to communicate and coordinate early on, "hey, I'm working on this thing in that file, let's talk".

Thoughts?

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.