Skip to content

Commit

Permalink
feat: Output the milestone number after creating it (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
hustcer authored Oct 26, 2024
1 parent 1aae167 commit 4d02785
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
name: Create Milestone
steps:
- name: Create Milestone
id: create
uses: hustcer/milestone-action@develop
with:
action: create
Expand All @@ -34,3 +35,6 @@ jobs:
description: ${{ github.event.inputs.description }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Output Milestone Number
run: echo "The new milestone number is ${{ steps.create.outputs.milestone_number }}"
3 changes: 3 additions & 0 deletions nu/milestone.nu
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ export def create-milestone [
let result = gh api -X POST $'/repos/($repo)/milestones' -F $'title=($title)' ...$dueOnArg ...$descArg
let milestone = $result | from json
print $'Milestone (ansi p)($milestone.title)(ansi reset) with NO. (ansi p)($milestone.number)(ansi reset) was created successfully.'
if 'GITHUB_OUTPUT' in $env {
echo $'milestone_number=($milestone.number)' o>> $env.GITHUB_OUTPUT
}
}

# Close milestone for a repository by title or number.
Expand Down

0 comments on commit 4d02785

Please sign in to comment.