CodelyTV / pr-size-labeler

🏷 Visualize and optionally limit the size of your Pull Requests
https://github.com/marketplace/actions/pull-request-size-labeler
MIT License
343 stars 61 forks source link

Label is not added for all pull requests #15

Open gasigo opened 4 years ago

gasigo commented 4 years ago

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

rgomezcasas commented 4 years ago

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

rgomezcasas commented 4 years ago

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

KarimFikani commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

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.

AlexBeauchemin commented 1 year ago

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'