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

label-pull-requests action should avoid restoring labels removed by maintainers #595

Open
carlocab opened this issue Sep 25, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@carlocab
Copy link
Member

carlocab commented Sep 25, 2024

It's really annoying to keep fighting with the label-pull-requests action when you've removed, say, CI-linux-self-hosted (e.g. because you know the bottle cache will kick in) but it keeps restoring it after every push.

This may require checking who removed the label before deciding to re-add it. Here's a GraphQL query for that:

query ($owner: String!, $repo: String!, $pr: Int!) {
  repository(owner: $owner, name: $repo) {
    pullRequest(number: $pr) {
      timelineItems(itemTypes: [UNLABELED_EVENT], last: 100) {
        nodes {
          ... on UnlabeledEvent {
            actor {
              login
            }
            label {
              name
            }
          }
        }
      }
    }
  }
}

It should be enough to check that the label wasn't removed by github-actions. Happy for this to be done with a simpler approach, though.

@carlocab carlocab changed the title label-pull-requests action should retain labels removed by maintainers label-pull-requests action should avoid restoring labels removed by maintainers Sep 25, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the Stale label Oct 17, 2024
@ZhongRuoyu ZhongRuoyu added help wanted Extra attention is needed and removed Stale labels Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants