actions / labeler

An action for automatically labelling pull requests
MIT License
1.99k stars 419 forks source link

`Error: HttpError: Not Found` on v5 when using the `configuration-path` input #702

Closed lfortin-cc closed 1 year ago

lfortin-cc commented 1 year ago

Description: When using the configuration-path input with a .github/labeler.yml checked out with the checkout action, I get Error: HttpError: Not Found. However, the same workflow is fine when I tested it with v4 and v4.3.0.

Action version:

Platform:

Runner type:

Repro steps:

.github/workflows/pr-workflows.yaml

name: PR checks
on:
  pull_request:
    types:
      - opened
      - reopened
      - edited
      - synchronize

jobs:
  pr-checks:
    uses: some-org/shared-workflows/.github/workflows/org-workflows.yaml
    permissions:
      contents: read
      issues: read
      pull-requests: write
    secrets: inherit

.github/workflows/org-workflows.yaml

name: PR format
on:
  workflow_call:

jobs:
  label:
    permissions:
      contents: read
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
    - name: Check out labeler.yml
      uses: actions/checkout@v4
      with:
        repository: "some-org/shared-workflows"
        token: ${{ secrets.WORKFLOW_TOKEN }}
        sparse-checkout: |
          .github/labeler.yml
        sparse-checkout-cone-mode: false
    - name: debug
      run: |
        ls -lah .github
        cat .github/labeler.yml
    - uses: actions/labeler@v5.0.0-alpha.1
      with:
        configuration-path: .github/labeler.yml

.github/labeler.yml

feature:
- head-branch: ['^Features/']

issue:
- head-branch: ['^Issues/']

By only changing the labeler version to v4 or v4.3.0, in the action logs I can see The configuration file (path: .github/labeler.yml) is found locally, reading from the file and the HttpError is gone. However the configuration depends on the labeling per branch name only introduced in v5.

Expected behavior: When using v5, I should see The configuration file (path: .github/labeler.yml) is found locally, reading from the file in the logs.

Actual behavior:

2023-11-10T21:01:36.9495915Z ##[debug]Evaluating condition for step: 'Run actions/labeler@v5.0.0-alpha.1'
2023-11-10T21:01:36.9497995Z ##[debug]Evaluating: success()
2023-11-10T21:01:36.9498733Z ##[debug]Evaluating success:
2023-11-10T21:01:36.9499471Z ##[debug]=> true
2023-11-10T21:01:36.9500132Z ##[debug]Result: true
2023-11-10T21:01:36.9502142Z ##[debug]Starting: Run actions/labeler@v5.0.0-alpha.1
2023-11-10T21:01:36.9541850Z ##[debug]Loading inputs
2023-11-10T21:01:36.9543979Z ##[debug]Evaluating: github.token
2023-11-10T21:01:36.9544662Z ##[debug]Evaluating Index:
2023-11-10T21:01:36.9545323Z ##[debug]..Evaluating github:
2023-11-10T21:01:36.9546064Z ##[debug]..=> Object
2023-11-10T21:01:36.9546849Z ##[debug]..Evaluating String:
2023-11-10T21:01:36.9548040Z ##[debug]..=> 'token'
2023-11-10T21:01:36.9554229Z ##[debug]=> '***'
2023-11-10T21:01:36.9554889Z ##[debug]Result: '***'
2023-11-10T21:01:36.9564102Z ##[debug]Loading env
2023-11-10T21:01:36.9571456Z ##[group]Run actions/labeler@v5.0.0-alpha.1
2023-11-10T21:01:36.9571931Z with:
2023-11-10T21:01:36.9572356Z   configuration-path: .github/labeler.yml
2023-11-10T21:01:36.9573035Z   repo-token: ***
2023-11-10T21:01:36.9573742Z   sync-labels: false
2023-11-10T21:01:36.9574610Z ##[endgroup]
2023-11-10T21:01:37.8468201Z ##[debug]fetching changed files for pr #12
2023-11-10T21:01:38.1208328Z ##[debug]found changed files:
2023-11-10T21:01:38.1209235Z ##[debug]  .github/workflows/pr_workflows.yaml
2023-11-10T21:01:38.1210315Z ##[debug]  foo
2023-11-10T21:01:38.3807130Z ##[error]HttpError: Not Found
2023-11-10T21:01:38.3817810Z ##[error]Not Found
2023-11-10T21:01:38.3845887Z ##[debug]Node Action run completed with exit code 1
2023-11-10T21:01:38.3854988Z ##[debug]Finishing: Run actions/labeler@v5.0.0-alpha.1
marko-zivic-93 commented 1 year ago

Hello @lfortin-cc Thank you for creating this issue. We will investigate it and come back to you as soon as we have some feedback.

MaksimZhukov commented 1 year ago

Hello @lfortin-cc! Unfortunately, v5.0.0-alpha.1 and v5.0.0-beta.1 do not contain these changes. To fix the issue please use v5.0.0-beta

    - uses: actions/labeler@v5.0.0-beta
      with:
        configuration-path: .github/labeler.yml
lfortin-cc commented 1 year ago

Thank you @MaksimZhukov it works with v5.0.0-beta. I will close this issue, but is there a reason why that version is not shown in the marketplace? I only saw the .1 variants of the alpha and beta there. image

MaksimZhukov commented 1 year ago

The reason is that this is not a version, this is a branch. We are going to release a new major version with these changes soon. Thank you for the patience!