pr-size-labeler icon indicating copy to clipboard operation
pr-size-labeler copied to clipboard

Label is not added for all pull requests

Open gasigo opened this issue 4 years ago • 6 comments

I've noticed that the label it's not being added for every pull request. The latest pull request where the label was not added had two labels with spaces in it. May not be related though. Any idea what could be the problem?

Thanks in advance

gasigo avatar Apr 29 '20 17:04 gasigo

Could you paste here the output of the action? (deleting all sensitive data)

rgomezcasas avatar Apr 29 '20 22:04 rgomezcasas

This was also reported in #16 with the output, so I fixed it in #17 :)

rgomezcasas avatar May 05 '20 12:05 rgomezcasas

@rgomezcasas I still don't see the label even after fix #17.

Here is my output:

This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. /src/github.sh: line 12: null: unbound variable Total modifications: /src/labeler.sh: line 37: [: : integer expression expected Labeling pull request with size/xl /src/labeler.sh: line 39: [: : integer expression expected /src/labeler.sh: line 41: [: : integer expression expected /src/labeler.sh: line 43: [: : integer expression expected jq: error (at :1): Cannot iterate over null (null) Final labels: "size/xl" { "message": "Not Found", "documentation_url": "https://developer.github.com/v3/issues/#edit-an-issue" } { "message": "Not Found", "documentation_url": "https://developer.github.com/v3/issues/comments/#create-a-comment" }

KarimFikani avatar May 08 '20 22:05 KarimFikani

@rgomezcasas also getting other errors too:

Total modifications: Labeling pull request with size/xl Final labels: "size/xl" { "message": "Not Found", "documentation_url": "https://developer.github.com/v3/issues/#edit-an-issue" } { "message": "Not Found", "documentation_url": "https://developer.github.com/v3/issues/comments/#create-a-comment" }

Not sure why the PR got labeled with size/xl and the PR has only +297 −98

KarimFikani avatar May 16 '20 04:05 KarimFikani

These errors show up when I changed

on: [pull_request] to on: [push]

because I wanted the size labeler to run on every push and not only when creating the pull request.

KarimFikani avatar Jul 27 '20 03:07 KarimFikani

I fixed the issue by adding the correct permissions to the task and commenting out the github_api_url

permissions:
  issues: write
  pull-requests: write
steps:
  ...
          # github_api_url: 'api.github.com'  

AlexBeauchemin avatar Jan 20 '23 19:01 AlexBeauchemin