pratikmallya / autolabeler-codeowners

✨🏷️ Github Action to add labels to PRs based on CODEOWNERS
MIT License
8 stars 8 forks source link

File not found: master/lib/main.js #10

Closed Lissy93 closed 3 years ago

Lissy93 commented 3 years ago

Hey @pratikmallya

This looks like it could be a really useful action :) I tried to set it up on one of my repos, but when running it, I get the following error:

Error: File not found: '/home/runner/work/_actions/pratikmallya/autolabeler-codeowners/master/lib/main.js'

Is this something that I am doing wrong, or maybe a bug?

For reference, here is the build log and my action YAML file. I've double-checked that my token is correct, and my .github/CODEOWNERS file is present.

Thanks very much :) Alicia


image

pratikmallya commented 3 years ago

Hey @Lissy93, could you try switching to release/v1 from master in the action yaml file? i.e. change

uses: pratikmallya/autolabeler-codeowners@master

to

uses: pratikmallya/autolabeler-codeowners@releases/v1

and try again?

I updated the readme to specify the correct branch, thanks for reporting this! Lmk if that works

Lissy93 commented 3 years ago

Awesome, thanks very much - that fixed it for me :)

Lissy93 commented 3 years ago

I noticed that as well as assigning the reviewer, the action also applies a tag to each PR with the users. Is this something that GitHub does automatically, or is there any way I can turn this off?

Since I don't like having too many tags cluttering up the Issues search, so don't want there to then be a tag for ever user in the owners file as well. image

pratikmallya commented 3 years ago

I noticed that as well as assigning the reviewer, the action also applies a tag to each PR with the users. Is this something that GitHub does automatically, or is there any way I can turn this off? Since I don't like having too many tags cluttering up the Issues search, so don't want there to then be a tag for ever user in the owners file as well.

The current algorithm is:

What do you think should the ideal behavior look like? Would you like it to ignore user-level codeowners and just tag with team-level codeowners? Or should there be a setting that just disables creation of labels, so it would use a label only if it was already present?

Lissy93 commented 3 years ago

Ah I see, thanks for explaining that, makes sense

I guess I was expecting the action to assign reviewers, but did not want the creation of labels- As PRs can be searched by reviewers, the same was they can with labels, so I don't know what additional benefit labels has.

Maybe a possible idea for a future update could be to add a parameter to make the tags optional. It's pretty low priority through, as the action works fine as is.

pratikmallya commented 3 years ago

I guess I was expecting the action to assign reviewers, but did not want the creation of labels- As PRs can be searched by reviewers, the same was they can with labels, so I don't know what additional benefit labels has.

That's right, PR's can be natively searched by reviewers, but not by github teams. The purpose of this action was to enable codeowning github teams to quickly know which open PR's were assigned to them in a monorepo (where there could be several different codeowning teams).

I do agree it doesn't make much sense to label with a reviewer, though. Let me see if I can restrict it to just teams.

Maybe a possible idea for a future update could be to add a parameter to make the tags optional. It's pretty low priority through, as the action works fine as is.

Just so we're on the same page, you're saying that the label creation should be optional, correct?