File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141 gh pr edit "$PR_NUMBER" --remove-label "missing-tests" 2>/dev/null || true
4242 fi
4343
44+ fixes-issue :
45+ runs-on : ubuntu-latest
46+ steps :
47+ - name : Check for linked closing issues
48+ env :
49+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50+ PR_NUMBER : ${{ github.event.pull_request.number }}
51+ REPO : ${{ github.repository }}
52+ run : |
53+ OWNER="${REPO%/*}"
54+ NAME="${REPO#*/}"
55+ COUNT=$(gh api graphql \
56+ -F owner="$OWNER" -F name="$NAME" -F number="$PR_NUMBER" \
57+ -f query='
58+ query($owner: String!, $name: String!, $number: Int!) {
59+ repository(owner: $owner, name: $name) {
60+ pullRequest(number: $number) {
61+ closingIssuesReferences(first: 1) {
62+ totalCount
63+ }
64+ }
65+ }
66+ }' \
67+ --jq '.data.repository.pullRequest.closingIssuesReferences.totalCount')
68+ if [ "${COUNT:-0}" -gt 0 ]; then
69+ gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "fixes-issue"
70+ else
71+ gh pr edit "$PR_NUMBER" --repo "$REPO" --remove-label "fixes-issue" 2>/dev/null || true
72+ fi
73+
4474 size-label :
4575 runs-on : ubuntu-latest
4676 steps :
You can’t perform that action at this time.
0 commit comments