github / github/update-project-action

[Bug] Action fails on pull request close

Đang mở
#12 0 bình luận 1 reaction 1 người được giao Được giao cho @Copilot Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
34
Fork
19
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.