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

Labels are not being correctly applied to PR using GITHUB_TOKEN #1074

Open
syaghoubi00 opened this issue Jan 14, 2025 · 2 comments
Open

Labels are not being correctly applied to PR using GITHUB_TOKEN #1074

syaghoubi00 opened this issue Jan 14, 2025 · 2 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@syaghoubi00
Copy link

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.

@syaghoubi00 syaghoubi00 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Jan 14, 2025
@syaghoubi00
Copy link
Author

#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.

✔ Successfully found branch HEAD sha "13765cf982996c53e86ac13e83115f7843c335ee".
✔ Successfully created branch at https://api.github.com/repos/syaghoubi00/actions-testing/git/refs/heads/release-please--branches--main
✔ Got the latest commit tree
✔ Successfully created a tree with the desired changes with SHA d37132e2365a94caa53e06b7ba7463ad1044faaa
✔ Successfully created commit. See commit at https://api.github.com/repos/syaghoubi00/actions-testing/git/commits/321629a5187e032566f82ae44fcb851229f2620b
✔ Updating reference heads/release-please--branches--main to 321629a5187e032566f82ae44fcb851229f2620b
✔ Successfully updated reference release-please--branches--main to 321629a5187e032566f82ae44fcb851229f2620b
✔ Successfully opened pull request available at url: https://api.github.com/repos/syaghoubi00/actions-testing/pulls/2.
✔ Successfully opened pull request: 2.
✔ Successfully added labels autorelease: pending to issue: 2

HEAD (19abe7a) - squash merge commit of PR-2

 ✔ Successfully found branch HEAD sha "19abe7a51489de29f6ab0ba7bc1288040b3ece28".
✔ Skipping branch creation step...
✔ Got the latest commit tree
✔ Successfully created a tree with the desired changes with SHA 32bc9007e09c658767393e7f7e9c00ccb0a432c0
✔ Successfully created commit. See commit at https://api.github.com/repos/syaghoubi00/actions-testing/git/commits/10256b31d6f177bfa9c74f6ecc34642c329f1d8c
✔ Updating reference heads/release-please--branches--main to 10256b31d6f177bfa9c74f6ecc34642c329f1d8c
✔ Successfully updated reference release-please--branches--main to 10256b31d6f177bfa9c74f6ecc34642c329f1d8c
✔ Successfully opened pull request available at url: https://api.github.com/repos/syaghoubi00/actions-testing/pulls/3.
✔ Successfully opened pull request: 3.
✔ Successfully added labels autorelease: pending to issue: 3

@Aaron-Ritter
Copy link

Aaron-Ritter commented Jan 15, 2025

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 autorelease: pending and autorelease: tagged it starts working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants