release-please-action: Labels are not being correctly applied to PR using `GITHUB_TOKEN`
version:
Run googleapis/release-please-action@v4
Running release-please version: 16.12.0
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 reporting Successfully added labels autorelease: pending.
Snippet of debug log:
✔ Successfully opened pull request: 2.
✔ Successfully added labels autorelease: pending to issue: 2
##[debug]Node Action run completed with exit code 0
##[debug]Set output releases_created = false
##[debug]Set output paths_released = []
##[debug]Set output prs_created = true
##[debug]Set output pr = {"headBranchName":"release-please--branches--main","baseBranchName":"main","number":2,"title":"chore(main): release 1.0.0","body":":robot: I have created a release *beep* *boop*\n---\n\n\n## 1.0.0 (2025-01-14)\n\n\n### Bug Fixes\n\n* test release ([13765cf](https://github.com/syaghoubi00/actions-testing/commit/13765cf982996c53e86ac13e83115f7843c335ee))\n\n---\nThis PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).","files":[],"labels":[]}
Possibly related: #1072 - however, adding the repository-projects: read permission did not fix the issue.
config:
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
repository-projects: read
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
release-type: simple
It might be worth noting that this isn’t a problem when using a PAT instead of the GH token.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 16
- Comments: 26
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:
Using ghaction-github-labeler solved this issue for me as well. Adding sample configuration here for anyone stumbling across this:
Same here,
I am using this in the pipeline for a temp fix.
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?
I think what is broken is what I’d term “autovivification” of labels.
Using the following:
The label
bugexists, the labelnonexistentdoes not. Onlybuggets added to the issue/PR. An HTTP 200 response code is always returned.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.
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)
Yes I even tried all different write permission, adding each one by one.
Seems to be GitHub that broke label creation permissions on the
GITHUB_TOKEN, not really arelease-pleaseissue, see here for other people experiencing the same with other actions: https://github.com/orgs/community/discussions/149877#discussioncomment-11952379@syaghoubi00
thats the part i tried successfully, i defined it as a job required before the release-please job:
https://github.com/sonderformat-llc/run-quickstart-e2e-test/blob/66fa6a481d5f40fd42ee7bb46c3d44a7296fccb8/.github/workflows/release.yaml#L18-L35
FYI i edited my earlier comment, i meant that i can create the labels manually with the
gh label createcommand. sorry for the confusionworks for me with the following permissions
clarification
Creating the labels manually works with these permissions. but i have to create the labels
This would explain why my older repositories continued to work, came here to note that label creation is blocked by default.
fyi i updated https://github.com/googleapis/release-please-action/issues/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
autorelease: pendingandautorelease: taggedit starts working