mschilde / auto-label-merge-conflicts

Github action to auto-label PRs with merge conflicts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Label is not automatically removed

TomW-Skyline opened this issue · comments

The action automatically adds the "conflict" label when needed, but when we resolve the conflict it's not being removed.

This is how our yml file looks like:

on:
  # So that PRs touching the same files as the push are updated
  push:
   branches: 
      - '**'
      
  # So that the `dirtyLabel` is removed if conflicts are resolve
  # We recommend `pull_request_target` so that github secrets are available.
  # In `pull_request` we wouldn't be able to change labels of fork PRs
  pull_request_target:
    types: [synchronize]

jobs:
  main:
    runs-on: ubuntu-latest
    steps:
      - name: check if prs are dirty
        uses: mschilde/auto-label-merge-conflicts@v2.0
        with:
          CONFLICT_LABEL_NAME: "conflict"
          GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Could it be that the default has conflicts is hardcoded for the removal action?
I was using the default and all seems working fine for me 🦩

I can confirm this bug. I'm experiencing the same thing and also using a custom label: CONFLICT_LABEL_NAME: "Status: has merge conflict"

After reviewing the source code, I can confirm that the has conflicts is not hardcoded 🤔 the code seems to be correctly reading the env var, in fact, the same "label object" is used to both add and remove labels from PRs… not sure why you guys are seeing this issue. I was about to test this GHA in a repo but now I'm not sure 😅

Actually just saw this PR and it totally makes sense now: #46

This PR should probably fix the issue you are seeing

Had this issue too, switched to https://github.com/eps1lon/actions-label-merge-conflict which works