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

Pr-Body-Labels Plugin throws 404 error in GitHub Actions #2195

Closed
bicstone opened this issue Apr 25, 2022 · 2 comments
Closed

Pr-Body-Labels Plugin throws 404 error in GitHub Actions #2195

bicstone opened this issue Apr 25, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@bicstone
Copy link

bicstone commented Apr 25, 2022

Describe the bug

Pr-Body-Labels plugin throws 404 error in GitHub Actions

Run npx auto pr-check \
  npx auto pr-check \
  --url ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} \
  --pr $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") \
  --verbose -v -vv
  shell: /usr/bin/bash -e {0}
  env:
    GH_TOKEN: ***

...

ℹ  info      Using command: 'pr-check' for 'https://github.com/bicstone/temp-auto-pr-body-labels/actions/runs/2220697485'
ℹ  info      Getting Pull Request: 1
ℹ  info      Getting pull request info using: { owner: 'bicstone', repo: 'temp-auto-pr-body-labels', pull_number: 1 }
ℹ  info      Got pull request data
...
ℹ  info      Got pull request info
ℹ  info      Creating "major" label to PR 1
ℹ  info      Removing "minor" from #1
ℹ  info      Removing "patch" from #1
ℹ  info      Got response from addLabels
...
ℹ  info      Added labels on Pull Request.
...
ℹ  info      Posting status to GitHub
 { description: 'Label does not exist', state: 'error' }
ℹ  info      Creating status using:
 {
  _all: {
    context: 'ci/pr-check',
    url: 'https://github.com/bicstone/temp-auto-pr-body-labels/actions/runs/2220697485',
    pr: 1,
    verbose: [ true, true, true, true ]
  },
  main: {
    pr: 1,
    url: 'https://github.com/bicstone/temp-auto-pr-body-labels/actions/runs/2220697485',
    context: 'ci/pr-check'
  },
  context: 'ci/pr-check',
  verbose: [ true, true, true, true ],
  _command: 'pr-check',
  description: 'Label does not exist',
  state: 'error',
  target_url: 'https://github.com/bicstone/temp-auto-pr-body-labels/actions/runs/2220697485',
  sha: undefined,
  owner: 'bicstone',
  repo: 'temp-auto-pr-body-labels'
}
Error: Failed to post status to Pull Request with error code 404
    at Auto.prCheck (/home/runner/work/temp-auto-pr-body-labels/temp-auto-pr-body-labels/node_modules/@auto-it/core/dist/auto.js:619:23)
    at async execute (/home/runner/work/temp-auto-pr-body-labels/temp-auto-pr-body-labels/node_modules/auto/dist/run.js:50:17)
    at async Object.runCli (/home/runner/work/temp-auto-pr-body-labels/temp-auto-pr-body-labels/node_modules/auto/dist/run.js:125:5)
Error: Process completed with exit code 1.

https://github.com/bicstone/temp-auto-pr-body-labels/runs/6158970503?check_suite_focus=true#step:5:1

To Reproduce

  1. npm install @auto-it/pr-body-labels
  2. Add "pr-body-labels" to .autorc.
  3. Run npx auto pr-check in GitHub Action

see https://github.com/bicstone/temp-auto-pr-body-labels/pull/1/files

Expected behavior

Process completed with exit code 0.

Environment information:

Run npx auto info
  npx auto info
  shell: /usr/bin/bash -e {0}
  env:
    GH_TOKEN: ***

Environment Information:

"auto" version: v10.36.5
"git"  version: v2.35.1
"node" version: v16.14.2

Project Information:

✔ Repository:      bicstone/temp-auto-pr-body-labels (​https://github.com/bicstone/temp-auto-pr-body-labels​)
✔ Author Name:     Oishi Takanori
✔ Author Email:    ***
✔ Current Version: v1.0.0
✔ Latest Release:  v1.0.0 (​https://github.com/bicstone/temp-auto-pr-body-labels/releases/tag/v1.0.0​)

✔ Labels configured on GitHub project 

GitHub Token Information:

✔ Token:            [Token starting with ghp_]
✔ Repo Permission:  admin
✔ User:             bicstone
✔ API:              undefined (​undefined​)
✔ Enabled Scopes:   repo
✔ Rate Limit:       4727/5000

https://github.com/bicstone/temp-auto-pr-body-labels/runs/6158960840?check_suite_focus=true#step:5:1

Additional context

When add "removeStaleLabels": false option, process completed with exit code 0.
I think the problem in the processing of remove unchecked labels.
#2173

https://github.com/bicstone/temp-auto-pr-body-labels/runs/6187531888?check_suite_focus=true#step:5:940
https://github.com/bicstone/temp-auto-pr-body-labels/pull/1/commits/54e5f651fc75f8ef28d6e0691eb51e4389114618

@bicstone bicstone added the bug Something isn't working label Apr 25, 2022
@bicstone bicstone changed the title Pr-Body-Labels Plugin exits with 404 error in GitHub Actions Pr-Body-Labels Plugin throws 404 error in GitHub Actions Apr 27, 2022
@taheraab
Copy link

Hi, we're facing the same issue. When can this fix be available?

@bicstone
Copy link
Author

I am not sure which version this is due to, but I have confirmed that this bug has already been fixed, so this issue is closed. Please clone this issue if necessary.
Have a great new year!

@bicstone bicstone closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants