Skip to content

Commit

Permalink
skip closing already closed milestone (#5869)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdabelf5 committed Jun 26, 2024
1 parent 9ddf871 commit 3f581b0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,17 @@ jobs:
/repos/${{ github.repository }}/milestones \
| jq --arg version "v${{ inputs.nic_version }}" -r \
'.[] | select(.title == $version) | .number')
if ! ${{ inputs.dry_run }}; then
gh api --method PATCH -H "Accept: application/vnd.github.v3+json" \
/repos/${{ github.repository }}/milestones/${milestone_number} \
-f "title=v${{ inputs.nic_version }}" \
-f "state=closed";
if [ -n "${milestone_number}" ]; then
if ! ${{ inputs.dry_run }}; then
gh api --method PATCH -H "Accept: application/vnd.github.v3+json" \
/repos/${{ github.repository }}/milestones/${milestone_number} \
-f "title=v${{ inputs.nic_version }}" \
-f "state=closed";
else
echo "Skipping closing Github Release milestone, DRY_RUN"
fi
else
echo "Skipping closing Github Release milestone, DRY_RUN"
echo "Github Milestone not available, closed already."
fi
- name: Get Github release id
Expand Down

0 comments on commit 3f581b0

Please sign in to comment.