From 294dc8ceea774df07f51fa34a672e81843c4a16d Mon Sep 17 00:00:00 2001 From: Joshua Sangmeister <33004050+jsangmeister@users.noreply.github.com> Date: Tue, 9 Apr 2024 16:02:06 +0200 Subject: [PATCH] Fix closes-issues action (#241) --- .github/workflows/close-issues.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/close-issues.yml b/.github/workflows/close-issues.yml index 98274a8..fcb5e99 100644 --- a/.github/workflows/close-issues.yml +++ b/.github/workflows/close-issues.yml @@ -38,15 +38,15 @@ jobs: } } variables: | - owner: ${{ github.event.repository.owner.name }} - repo: ${{ github.event.repository.name }} + owner: ${{ github.repository_owner }} + name: ${{ github.event.repository.name }} number: ${{ github.event.pull_request.number }} - name: Close issues env: GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} run: | - issue_data="$(echo "${{ steps.get-issues.outputs.data }}" | jq -r '.data.repository.pullRequest.closingIssuesReferences.nodes[] | [.number,.repository.nameWithOwner] | @tsv')" - echo "$issue_data" | while read number nameWithOwner; do + issue_data="$(echo '${{ steps.get-issues.outputs.data }}' | jq -r '.repository.pullRequest.closingIssuesReferences.nodes[] | [.number,.repository.nameWithOwner] | @tsv')" + echo "$issue_data" | grep -v "^$" | while read number nameWithOwner; do gh issue close "$number" -r "$nameWithOwner" done