Skip to content

Commit d3cdd83

Browse files
committed
Fix CI errors
- Avoid `${{ ... }}` syntax inside `run:` - Use mapfile command rather than `URL=( $(...) )`
1 parent 9ac78c0 commit d3cdd83

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/close-issues-on-merge.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,21 @@ jobs:
2626
- name: "Find and close linked issues"
2727
env:
2828
GH_TOKEN: ${{ secrets.PHPSTAN_BOT_TOKEN }}
29+
GH_REPO: ${{ github.repository }}
30+
PR_NUMBER: ${{ github.event.pull_request.number }}
31+
PR_URL: ${{ github.event.pull_request.html_url }}
2932
run: |
30-
URLS=(
31-
$(gh pr view ${{ github.event.pull_request.number }} --repo "$GITHUB_REPOSITORY" --json closingIssuesReferences --jq '.closingIssuesReferences[].url')
33+
mapfile -t URLS < <(
34+
gh pr view "$PR_NUMBER" --json closingIssuesReferences --jq '.closingIssuesReferences[].url'
3235
)
3336
3437
if (( ${#URLS[@]} == 0 )); then
3538
echo "No issues are linked to this PR"
3639
exit 0
3740
fi
3841
39-
for url in "${URLS[@]}"; do
40-
NUMBER=${url##*/}
41-
echo "Closing phpstan/phpstan#${NUMBER}"
42-
gh issue close "$url" --comment "Closed via merging ${{ github.event.pull_request.html_url }}"
42+
for issue_url in "${URLS[@]}"; do
43+
issue_number=${issue_url##*/}
44+
echo "Closing phpstan/phpstan#${issue_number}"
45+
gh issue close "$issue_url" --comment "Closed via merging $PR_URL"
4346
done

0 commit comments

Comments
 (0)