IvanFon / super-labeler-action

A superpowered issue and pull request labeler for Github Actions.
GNU General Public License v3.0
22 stars 12 forks source link

label config issue #30

Open yeeteing opened 3 years ago

yeeteing commented 3 years ago

Describe the bug

  1. descriptionMatches was being activated even the pattern is being shown in commit. I thought descriptionMatches is only valid for pull request description, and commit should not trigger the labeling generation.

  2. For:

{
  "bugfix": {
      "requires": 1,
      "conditions": [
        {
          "type": "branchMatches",
          "pattern": "/^fix|^bug/i"
        },
        {
          "type": "titleMatches",
          "pattern": "/bug|fix/i"
        }
      ]
    }
}

I would assume that "requires": means how many conditions need to match in order to activate the labeling generator. So, if "requires" is 1, is that mean I just need one "conditions" to be valid to activate the bugfix label?

  1. Pull request title is "add something", I would assume this will trigger the auto labeling base on the config I have below:
    "feature": {
      "requires": 1,
      "conditions": [
        {
          "type": "branchMatches",
          "pattern": "/^feature/i"
        },
        {
          "type": "titleMatches",
          "pattern": "/create|add|generat|buil|allow/i"
        },
        {
          "type": "descriptionMatches",
          "pattern": "/create|add|generat|buil|allow/i"
        }
      ]
    }
TGTGamer commented 3 years ago

Heya @yeeteing

Sorry but I'm a little slow today and struggling to follow your issue.

  1. descriptionMatches was being activated even the pattern is being shown in commit. I thought descriptionMatches is only valid for pull request description, and commit should not trigger the labeling generation.

So is the commit being added to a branch that has an open pull request? And this is then triggering the descriptionMatches config? Is that right?

I would assume that "requires": means how many conditions need to match in order to activate the labeling generator. So, if "requires" is 1, is that mean I just need one "conditions" to be valid to activate the bugfix label?

You are right. If it requires: 1, it will activate if 1 or more condition matches. In branch #24 there is an $and, $or and $only which I don't believe have been ported over to this project yet.

  1. Pull request title is "add something", I would assume this will trigger the auto labeling base on the config I have below:

Yes, this would trigger the auto labeling. IF you are not triggering it, could you provide the logs so we can investigate?

To provide the logs: Please set the ACTIONS_RUNNER_DEBUG secret to true to enable debug logging, rerun the labeler workflow

You can see an example of how we utilize this function here: https://github.com/Videndum/action-masterminds/blob/4ad0ff689353b86a122b3c0c5eace7303a7cd998/.github/allconfigs.json#L1071-L1083

yeeteing commented 3 years ago

So is the commit being added to a branch that has an open pull request? And this is then triggering the descriptionMatches config? Is that right?

Yup, correct. I also noticed that even though I didn't include descriptionMatches config, it's still triggered the auto labeling when I have some keyword being added in the description of the PR.

 "modified": {
      "requires": 1,
      "conditions": [
        {
          "type": "branchMatches",
          "pattern": "/modif|change|update/i"
        },
        {
          "type": "titleMatches",
          "pattern": "/restructure|modif|change|update|move|moving/i"
        }
      ]
    }
TGTGamer commented 3 years ago

@yeeteing can you link me or screenshot the open PR for me please

yeeteing commented 2 years ago

I did not get any log Screen Shot 2021-10-07 at 12 22 43 PM

yeeteing commented 2 years ago

Screen Shot 2021-10-07 at 12 23 11 PM