File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments