Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add actions/labeler #26962

Merged
merged 16 commits into from Sep 7, 2023
Merged

Add actions/labeler #26962

merged 16 commits into from Sep 7, 2023

Conversation

silverwind
Copy link
Member

Implements GiteaBot/gitea-backporter#93 using actions/labeler. Very basic configuration, can be extended later.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 7, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 7, 2023
@silverwind silverwind added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Sep 7, 2023
@silverwind
Copy link
Member Author

It does not seem to run on pull_request_target which itself seems to be some workaround related to permissions. Or maybe it will run on pull_request_target after merging only. I'll revert to it now because on pull_request fails to obtain the right permissions (likely needs a write token).

@silverwind
Copy link
Member Author

I don't know why this pull_request_target does not run. Either it only works after this has merged or some permissions on our repo may prevent it from working.

@techknowlogick
Copy link
Member

techknowlogick commented Sep 7, 2023

@silverwind just pushed a trivial change, hopefully it triggers now.
edit: nope

@silverwind
Copy link
Member Author

silverwind commented Sep 7, 2023

For some reason the workflow doesn't even show up in the list. It did show up when I set on: pull_request but that ran into the mentioned permission error and it's better to run on pull_request_target because of the special permissions associated with it.

@silverwind silverwind closed this Sep 7, 2023
@silverwind silverwind reopened this Sep 7, 2023
docs/README.md Outdated Show resolved Hide resolved
@silverwind
Copy link
Member Author

Maybe we actually need to merge this to work on subsequent PRs. From docs:

This event runs in the context of the base of the pull request, rather than in the context of the merge commit, as the pull_request event does

@silverwind
Copy link
Member Author

PR is in a mergeable state if we want to try above.

@silverwind
Copy link
Member Author

silverwind commented Sep 7, 2023

So I'm pretty positive this can only work once merged. The action runs on the target branch with write access to github api to set labels. It obtains changed files from API and uses the config in the repo. But because the target branch (main) has no config or workflow yet, it does not work on the initial PR.

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 7, 2023
@silverwind
Copy link
Member Author

Added some more, I think this is good enough now. We should see it working after merge.

Comment on lines 18 to 19
- go.mod
- go.sum
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a PR imports a new module, this PR gets labeled as dependencies?

Copy link
Member Author

@silverwind silverwind Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, at least that's my understanding of the label. It says "Pull requests that update a dependency file". We can of course remove the setting of this label entirely if it's not useful, but I do see the addition/modification of depdendencies a important property on a PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the dependencies now for two reasons:

  • The label does not follow the kind/ prefix
  • I don't want to go overboard with label spam

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 7, 2023
Copy link
Member

@KN4CK3R KN4CK3R left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try it.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 7, 2023
@techknowlogick techknowlogick enabled auto-merge (squash) September 7, 2023 21:28
@techknowlogick techknowlogick added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Sep 7, 2023
@techknowlogick techknowlogick merged commit cfa3527 into go-gitea:main Sep 7, 2023
24 checks passed
@GiteaBot GiteaBot added this to the 1.22.0 milestone Sep 7, 2023
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Sep 7, 2023
@silverwind silverwind deleted the labeler branch September 7, 2023 22:03
@silverwind
Copy link
Member Author

Fixup: #26964

@techknowlogick techknowlogick modified the milestones: 1.22.0, 1.21.0 Sep 8, 2023
zjjhot added a commit to zjjhot/gitea that referenced this pull request Sep 8, 2023
* giteaofficial/main:
  Add `yamllint` (go-gitea#26965)
  Fix yaml quoting (go-gitea#26964)
  [skip ci] Updated translations via Crowdin
  Add `actions/labeler` (go-gitea#26962)
  Team invite url fix when registration disabled (go-gitea#26950)
  Refactor dashboard/feed.tmpl (go-gitea#26956)
  Improve hint when uploading a too large avatar (go-gitea#26935)
  Replace `util.SliceXxx`  with `slices.Xxx`  (go-gitea#26958)
  Add reverseproxy auth for API back with default disabled (go-gitea#26703)
  Add "dir=auto" for input/textarea elements by default (go-gitea#26735)
@silverwind
Copy link
Member Author

It works:

image

#26970

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants