Skip to content

[Github Action] Label community issues #1746

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

Conversation

florent-leborgne
Copy link
Contributor

@florent-leborgne florent-leborgne commented Jun 16, 2025

Generated with Copilot

This is an attempt to identify community (from non-elasticians) issues more accurately rather than rely only on source:web label or on the triager checking the issue author's profile every time.

@florent-leborgne florent-leborgne requested a review from a team as a code owner June 16, 2025 16:01

try {
// Check if the user is a member of the elastic organization
await github.rest.orgs.getMembershipForUser({
Copy link
Member

Choose a reason for hiding this comment

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

unfortunately, I'm afraid this won't work with the standard github token.

You need a PAT that is able to read org membership

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Argh yes I didn't consider most of our users have private membership.

Can we use a PAT that we store somewhere safe and invoke it here?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. Adding it to the GitHub repository secrets should be sufficient for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice, is this something you can help with? I don't have any permissions to do such things I believe

Copy link
Member

Choose a reason for hiding this comment

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

image

I created the ORG_MEMBER_READ_TOKEN which can be accessed with secrets.ORG_MEMBER_READ_TOKEN.

For now it's configured to our max TTL. We can revisit this in a couple of months.

The platform team is working on ephemeral token service that we can utilize in the future.

Copy link
Member

Choose a reason for hiding this comment

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

The token can only read the membership. Hence you might need to split the script into two steps. One for reading and one for adding the label

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok thank you :) will look into it later!

@florent-leborgne
Copy link
Contributor Author

@reakaleek Thanks for your help, I updated the script, let me know if you think this could work. Thanks!

Copy link
Member

@reakaleek reakaleek left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@florent-leborgne
Copy link
Contributor Author

Nice let's see how it works

@florent-leborgne florent-leborgne enabled auto-merge (squash) June 24, 2025 09:15
@florent-leborgne florent-leborgne merged commit f31413c into elastic:main Jun 24, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants