github / github/update-project-action

[Bug] Action fails on pull request close

Abierto
#12 0 comentarios 1 reacción 1 asignado Asignado a @Copilot Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
34
Forks
19
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### Issue
If a pull request is closed without merging, the action fails with an error at the `Parse content metadata` step.

### Example
```
jq: error (at organization-Breadcord-issue-PR_kwDOItt-hs5Gk46V.json:0): Cannot iterate over null (null)
```

Full debug log from running [this job](https://github.com/Breadcord/Breadcord-Actions-Test/actions/runs/3833859102/jobs/6525848814) in a repository: [debug.log](https://github.com/github/update-project-action/files/10340606/debug.log)

The relevant code from the workflow file:
```yml
on:
issues:
types: [ closed ]
pull_request:
types: [ closed ]

if_closed:
name: Mark as Closed
if: ${{ github.event.issue.state_reason == 'not_planned' || (github.event_name == 'pull_request' && !github.event.pull_request.merged) }}
runs-on: ubuntu-latest
steps:
- uses: Breadcord/update-project-action@main
with:
github_token: ${{ secrets.ACTIONS_TOKEN }}
organization: Breadcord
project_number: 1
content_id: ${{ github.event.issue.node_id || github.event.pull_request.node_id }}
field: Status
value: Closed
```

Note that `Breadcord/update-project-action` is a clone of this action, but with PRs #8 and #10 merged in.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.