Wrong endpoint for listing comments

Abierto
#644 0 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
github, github-actions, javascript
Área
api, tooling

Línea de trabajo

Start by reproducing the github.rest.issues.listComments call from actions/github-script and inspect the generated request URL, especially the trailing slash shown in the error. Trace how the endpoint is assembled and verify that listing comments succeeds with the corrected URL, including pagination.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Hello,

I'm using this:

const { owner, repo } = context.repo;
const issue_number = context.issue.number;
const comments = await github.paginate(github.rest.issues.listComments, { owner, repo, issue_number, per_page: 100 });

And it crashes with:

Run actions/github-script@v7
  
RequestError [HttpError]: Not Found
    at /home/runner/work/_actions/actions/github-script/v6/dist/index.js:6842:21
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async eval (eval at callAsyncFunction (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15143:16), <anonymous>:10:3)
    at async main (/home/runner/work/_actions/actions/github-script/v6/dist/index.js:15236:20) {
  status: 404,
  response: {
    url: 'https://api.github.com/repos/{ORG}/{REPO}/comments/',
    status: 404,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset',
...

I've elided ORG and REPO because they're not important. The important part is the trailing slash at the end of the url, which yields a 404. Without the trailing / i.e. 'https://api.github.com/repos/{ORG}/{REPO}/comments', the API doesn't answer 404

Lenguaje dominante
TypeScript
Estrellas
5k
Forks
586
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de actions/github-script

Todos los issues de actions/github-script

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.