Skip to content

Commit 05e6f59

Browse files
committed
skip closing already closed milestone (#5869)
1 parent 21e29e5 commit 05e6f59

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,17 @@ jobs:
416416
/repos/${{ github.repository }}/milestones \
417417
| jq --arg version ${{ inputs.nic_version }} -r \
418418
'.[] | select(.title == $version) | .number')
419-
if ! ${{ inputs.dry_run }}
420-
gh api --method PATCH -H "Accept: application/vnd.github.v3+json" \
421-
/repos/${{ github.repository }}/milestones/${milestone_number} \
419+
if [ -n "${milestone_number}" ]; then
420+
if ! ${{ inputs.dry_run }}; then
421+
gh api --method PATCH -H "Accept: application/vnd.github.v3+json" \
422+
/repos/${{ github.repository }}/milestones/${milestone_number} \
423+
-f "title=v${{ inputs.nic_version }}" \
424+
-f "state=closed";
425+
else
426+
echo "Skipping closing Github Release milestone, DRY_RUN"
427+
fi
422428
else
423-
echo "Skipping closing Github Release milestone, DRY_RUN"
429+
echo "Github Milestone not available, closed already."
424430
fi
425431
426432
- name: Get Github release id

0 commit comments

Comments
 (0)