All Projects → mschilde → auto-label-merge-conflicts

mschilde / auto-label-merge-conflicts

Licence: MIT license
Github action to auto-label PRs with merge conflicts

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to auto-label-merge-conflicts

django-step-by-step
A Django + Vue reference project that focuses on developer tooling and CI/CD + IaC
Stars: ✭ 86 (+115%)
Mutual labels:  github-actions
nextjs-cron
Cron jobs with Github Actions for Next.js apps on Vercel▲
Stars: ✭ 144 (+260%)
Mutual labels:  github-actions
ftp-action
Automate copying your files via FTP using this GitHub action.
Stars: ✭ 90 (+125%)
Mutual labels:  github-actions
action-eslint
🐋🐬 TypeScript/JavaScript ESLint action
Stars: ✭ 24 (-40%)
Mutual labels:  github-actions
ts-scaffold
🏗 ts-scaffold - Scaffold project for Typescript projects, with Unit Tests and basic dependencies set up
Stars: ✭ 13 (-67.5%)
Mutual labels:  github-actions
no-free-usage-action
A NO-FREE-USAGE action for github. (Only worked with github action.)
Stars: ✭ 51 (+27.5%)
Mutual labels:  github-actions
ghaction-virustotal
GitHub Action to upload and scan files with VirusTotal
Stars: ✭ 105 (+162.5%)
Mutual labels:  github-actions
engine
A personal game engine project, with development focus towards 2D/2.5D games.
Stars: ✭ 32 (-20%)
Mutual labels:  github-actions
chicio.github.io
👻 Fabrizio Duroni (me 😄) personal website. Created using GatsbyJS, Styled Components, Storybook, Typescript, tsParticles, GitHub pages, Github Actions, Upptime.
Stars: ✭ 20 (-50%)
Mutual labels:  github-actions
pandoc-action
github action to run pandoc, soft-deprecated ->
Stars: ✭ 39 (-2.5%)
Mutual labels:  github-actions
actions-deploy-gist
📌 Deploy file to Github Gist
Stars: ✭ 26 (-35%)
Mutual labels:  github-actions
setup-bats
GitHub Action to setup BATS testing framework
Stars: ✭ 25 (-37.5%)
Mutual labels:  github-actions
slsa-provenance-action
Github Action implementation of SLSA Provenance Generation
Stars: ✭ 34 (-15%)
Mutual labels:  github-actions
netlify-build-github-actions
An example of triggering a Netlify build using Github Actions Scheduled Events
Stars: ✭ 31 (-22.5%)
Mutual labels:  github-actions
actions
Set of actions for implementing CI/CD with werf and GitHub Actions
Stars: ✭ 67 (+67.5%)
Mutual labels:  github-actions
deploy-to-vercel-action
🎬▲ Deploy your project to Vercel using GitHub Actions. Supports PR previews and GitHub deployments.
Stars: ✭ 84 (+110%)
Mutual labels:  github-actions
actions
github actions stuff
Stars: ✭ 39 (-2.5%)
Mutual labels:  github-actions
actions-mention-to-slack
Github Action for convert Github mention to Slack mention.
Stars: ✭ 52 (+30%)
Mutual labels:  github-actions
github-action-gitflow-release-workflow
Example workflows for automated releases in a GitFlow-style project using GitHub actions.
Stars: ✭ 91 (+127.5%)
Mutual labels:  github-actions
jsdoc-action
📖 GitHub Action to build JSDoc documentation
Stars: ✭ 61 (+52.5%)
Mutual labels:  github-actions

auto-label-merge-conflicts

A Github action to auto-label PRs with merge conflicts

Purpose

This action checks all open Pull Requests for merge conflicts and marks them with a Github label.

Github action in action

Once a conflict is resolved the label is automatically removed.

The typical use case is to run this action post merge (e.g. push to master) to quickly see which other PRs are now in conflict.

We use this setup e.g. on our monorepo at Comtravo. Instead of a grumpy CTO pinging developers to fix their merge conflicts there's now a shiny bot.

Set up

To configure the action on your repo you have to do 2 things:

  1. pick a Github label that should be used to mark PRs with conflicts This label will then be managed by this action. It will be added to PRs with merge conflicts and removed from PRs without conflicts.

  2. configure the new workflow by creating a YML config file in your .github/workflows folder:

on:
  push:
    branches:
      - master
jobs:
  triage:
    runs-on: ubuntu-latest
    steps:
      - uses: mschilde/auto-label-merge-conflicts@master
        with:
          CONFLICT_LABEL_NAME: "has conflicts"
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          MAX_RETRIES: 5
          WAIT_MS: 5000

The label from step 1 should be referenced in the parameter CONFLICT_LABEL_NAME

Take a look at this repo for an example setup.

Arguments:

  • CONFLICT_LABEL_NAME: label used for marking conflicts, note that such label has to exist in your repo
  • MAX_RETRIES: optional (default 5)
  • WAIT_MS: optional (default 5000)

Limitations

Github does not reliably compute the mergeable status which is used by this action to detect merge conflicts.

If master changes the mergeable status is unknown until someone (most likely this action) requests it. Github then tries to compute the status with an async job.

This is usually quick and simple, but there are no guarantees and Github might have issues. You can tweak MAX_RETRIES and WAIT_MS to increase the timeout before giving up on a Pull Request.

Local dev setup

To play around with the code base, you need Docker and make set up locally.

Run make build, make develop, then yarn install.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].