Skip to content

fix autolabeler by adding labeler.yml action #87

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

Merged
merged 7 commits into from
Mar 13, 2024
Merged

Conversation

shenxianpeng
Copy link
Contributor

@shenxianpeng shenxianpeng added the bug Something isn't working label Mar 8, 2024
@2bndy5

This comment has been minimized.

@shenxianpeng shenxianpeng removed the bug Something isn't working label Mar 8, 2024
@github-actions github-actions bot added the bug Something isn't working label Mar 8, 2024
@shenxianpeng
Copy link
Contributor Author

expect docs CI failed, the autolabeler works as expected.

I also add an input parameter commitish to fix the errors per the solution of release-drafter/release-drafter#1125 (comment)

@shenxianpeng shenxianpeng reopened this Mar 8, 2024
@2bndy5
Copy link
Contributor

2bndy5 commented Mar 8, 2024

TL;DR We need to use a different action to generate labels in a PR.

The issue you linked to has diverged into 2 issues.

  1. release-drafter cannot create a drafted release in a PR event (including pull_request_target). This is why the error occurs.
  2. release-drafter's auto-labeler feature needs to be run in a PR event.

But there is currently no way differentiate which feature of release-drafter you want to use in specified event trigger. Using the commitish advice will fix the error in a PR event, but it will prevent auto-labeler from doing what it supposed to.

@shenxianpeng shenxianpeng reopened this Mar 13, 2024
@shenxianpeng shenxianpeng removed the bug Something isn't working label Mar 13, 2024
@github-actions github-actions bot added the bug Something isn't working label Mar 13, 2024
@shenxianpeng shenxianpeng requested a review from 2bndy5 March 13, 2024 03:44
@shenxianpeng
Copy link
Contributor Author

Per your comments, I added a new action to autolabeler. From my test, the event pull_request_target can not trigger run so I changed it to pull_request and it works.

@shenxianpeng shenxianpeng changed the title fix autolabeler by adding pull request events fix autolabeler by adding labeler.yml action Mar 13, 2024
Copy link
Contributor

@2bndy5 2bndy5 left a comment

Choose a reason for hiding this comment

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

I'm surprised that this works without errors. It seems to use the commitish advice (in reusable workflow), but the labels (ie "bug" in this PR) are still assigned to the PR properly.

shenxianpeng and others added 2 commits March 13, 2024 20:34
Co-authored-by: Brendan <2bndy5@gmail.com>
Co-authored-by: Brendan <2bndy5@gmail.com>
@shenxianpeng
Copy link
Contributor Author

It would be work to keep or remove commitish from reusable workflow.

@2bndy5
Copy link
Contributor

2bndy5 commented Mar 13, 2024

Is that why commitish is hard-coded in the reusable workflow?

@shenxianpeng
Copy link
Contributor Author

I think so. commitish has default value in reusable workflow, it can be overwrite when the default branch is not main, for example: master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants