-
Notifications
You must be signed in to change notification settings - Fork 226
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
Labels are not being correctly applied to PR using GITHUB_TOKEN
#1074
Comments
#1028 - May also be related, as merging the unlabeled PR causes another PR to be opened instead of creating the release. #1006 seems to confirm the that the labeling issue is causing a loop.
HEAD (19abe7a) - squash merge commit of PR-2
|
fyi i updated #1072 it does only work once you've run it once with a PAT and then switch back to the normal github_token. It is not creating the labels. when you manually create two labels |
This would explain why my older repositories continued to work, came here to note that label creation is blocked by default. |
@axieum do you know a way to allow the label creation? none of the github_token permissions work, so is it a configuration or does it mean we have to create the labels manually? |
I'm not entirely sure, I just created the two labels and called it a day. Once it's setup and running, it's fine - just a minor inconvenience. 😅 |
you can do that with an action like https://github.com/crazy-max/ghaction-github-labeler for instance |
someone tried with the permission |
I guess it's a valid workaround by side manually creating then, but release-please explicitly states that they create these labels so it still is a bug, would you agree? |
Yes I even tried all different write permission, adding each one by one. |
I was able to correct this issue by creating labels first, using the cli. Once the labels exist, there appear to be no issues. When I tried to add a label using gh cli, to the PR, it said the label did not exist. It seems that labels are not auto-creating when adding them to a PR. I added this to all my newly created repos using release-please, to resolve the issue:
|
alternative: I used https://github.com/crazy-max/ghaction-github-labeler to make sure the labels exists |
ok, so the prob is not the action cannot create the labels, it's that it does not try to create it if it doesn't exist (it seems) |
Different scenario here , using token from github app with read-write access to pull-requests (hence access to labels).
still the PR has no labels attached. the action has always created this labels, i don't recall to ever have created this labels manually |
Using ghaction-github-labeler solved this issue for me as well. Adding sample configuration here for anyone stumbling across this: # .github/labels.yml
- name: "autorelease: pending"
color: "d73a4a"
description: "Pending release"
- name: "autorelease: tagged"
color: "d4c5f9"
description: "Ready for release"
- name: "autorelease: snapshot"
color: "d4c5f9"
description: "Ready for release"
- name: "autorelease: published"
color: "0e8a16"
description: "Released" # .github/workflows/labels.yml
name: github-labels
on:
push:
branches:
- 'main'
paths:
- '.github/labels.yml'
- '.github/workflows/labels.yml'
pull_request:
paths:
- '.github/labels.yml'
- '.github/workflows/labels.yml'
jobs:
labeler:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-delete: true
dry-run: ${{ github.event_name == 'pull_request' }} |
I have the same problem. I had to manually tag (autorelease: pending) and finally the loop stopped. But this was not necessary before |
Same here,
I am using this in the pipeline for a temp fix. |
I think this is a wider GitHub issue, some behaviour which was previously relied on has changed. We also use Renovate which should also be creating and adding labels to PRs but I notice it's not creating them either, without any sort of error. Like release-please, this used to work. FYI I'm using an App with Edit: I have an enterprise account so I've raised a support ticket to find out more. |
works for me with the following permissions
clarification Creating the labels manually works with these permissions. but i have to create the labels |
@Aaron-Ritter I just tried the action with those permissions in a private and public repo and it is still not creating the labels and is doing the PR loop. I don't think it's a permission issue, as I just tried |
thats the part i tried successfully, i defined it as a job required before the release-please job: FYI i edited my earlier comment, i meant that i can create the labels manually with the |
Seems to be GitHub that broke label creation permissions on the |
up-voted |
I think what is broken is what I'd term "autovivification" of labels. Using the following:
The label I'm assuming previously any label that didn't exist when adding it to an issue/PR would be automatically created/vivified. I've tried the built in token and an app token, both only with write permission on pull requests and both only add labels that already exist. |
@bodgit Yes, I confirm that too. At least up until ~December 2024 (not 100% sure the exact date) the missing label would be auto-created in the repository. But that doesn't happen anymore. |
I've just noticed that labels are being automatically created again, at least for me anyway. |
@bodgit the labels are working again for me too. The I still think the issue should be left open though -- even though the labels are working again. |
version:
It seems like
release-please
thinks it is adding the label successfully, even though no labels are added.I ran the action with debug log enabled, and at the end of the pr output,
"labels":[]
is empty, but reportingSuccessfully added labels autorelease: pending
.Snippet of debug log:
Possibly related: #1072 - however, adding the
repository-projects: read
permission did not fix the issue.config:
It might be worth noting that this isn't a problem when using a PAT instead of the GH token.
The text was updated successfully, but these errors were encountered: