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

PR size labeler is not working #41

Closed simrk closed 2 years ago

simrk commented 2 years ago

Hi! First of all, thank you for this action!

So here is our issue, it seems like the label isn't applied anymore. Here you can find the logs:

2022-05-17T13:12:19.8359002Z /src/github.sh: line 15: null: unbound variable
2022-05-17T13:12:19.8361467Z Total modifications (additions + deletions): 
2022-05-17T13:12:19.8362674Z Ignoring files (if present): 
2022-05-17T13:12:19.8372382Z /src/labeler.sh: line 49: [: : integer expression expected
2022-05-17T13:12:19.8372724Z /src/labeler.sh: line 51: [: : integer expression expected
2022-05-17T13:12:19.8373037Z /src/labeler.sh: line 53: [: : integer expression expected
2022-05-17T13:12:19.8373339Z /src/labeler.sh: line 55: [: : integer expression expected
2022-05-17T13:12:19.8375026Z Labeling pull request with size/xl
2022-05-17T13:12:20.1232720Z jq: error (at <stdin>:1): Cannot iterate over null (null)
2022-05-17T13:12:20.1255564Z Final labels: "size/xl"
2022-05-17T13:12:20.6126579Z {
2022-05-17T13:12:20.6127218Z   "message": "Not Found",
2022-05-17T13:12:20.6128176Z   "documentation_url": "https://docs.github.com/rest/reference/issues#create-an-issue-comment"
2022-05-17T13:12:20.6128657Z }
2022-05-17T13:12:20.7627548Z Cleaning up orphan processes

This is the dev workflow we have enabled:

name: Size Labeler

on: [pull_request]

jobs:
  labeler:
    runs-on: ubuntu-latest
    name: Label the PR size
    steps:
      - uses: codelytv/pr-size-labeler@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          xs_max_size: '10'
          s_max_size: '100'
          m_max_size: '500'
          l_max_size: '1000'
          fail_if_xl: 'false'
          message_if_xl: >
            'This PR exceeds the recommended size of 1000 lines.
            Please make sure you are NOT addressing multiple issues with one PR.
            Note this PR might be rejected due to its size.’
          github_api_url: 'api.github.com'

Can someone have a look at this?

simrk commented 2 years ago

Duplicate issue.

Leo6Leo commented 1 year ago

Just leave the solution link I found to save some time for people

https://github.com/CodelyTV/pr-size-labeler/issues/40#issuecomment-1142130933v

name: labeler

on: [pull_request]

jobs:
  labeler:
    runs-on: ubuntu-latest
    name: Label the PR size
    steps:
      - uses: codelytv/pr-size-labeler@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          xs_label: 'size/xs'
          xs_max_size: '10'
          s_label: 'size/s'
          s_max_size: '100'
          m_label: 'size/m'
          m_max_size: '500'
          l_label: 'size/l'
          l_max_size: '1000'
          xl_label: 'size/xl'
          fail_if_xl: 'false'
          message_if_xl: >
            This PR exceeds the recommended max size of 1000 lines.
            Please make sure you are NOT addressing multiple issues with one PR.
          files_to_ignore: 'package-lock.json'