Skip to content

Commit

Permalink
ci(github-release): update the previous release if it exists (autowar…
Browse files Browse the repository at this point in the history
…efoundation#261)

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
  • Loading branch information
kenji-miyake authored May 2, 2022
1 parent 22000ee commit 7012c96
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/github-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,23 @@ jobs:
id: generate-changelog
uses: autowarefoundation/autoware-github-actions/generate-changelog@v1

- name: Select verb
id: select-verb
run: |
has_previous_draft=$(gh release view --json isDraft -q ".isDraft" "${{ steps.set-tag-name.outputs.tag-name }}")
verb=create
if [ "$has_previous_draft" = "true" ]; then
verb=edit
fi
echo ::set-output name=verb::"$verb"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release to GitHub
run: |
gh release create "${{ steps.set-tag-name.outputs.tag-name }}" \
gh release ${{ steps.select-verb.outputs.verb }} "${{ steps.set-tag-name.outputs.tag-name }}" \
--draft \
--target "${{ steps.set-target-name.outputs.target-name }}" \
--title "Release ${{ steps.set-tag-name.outputs.tag-name }}" \
Expand Down

0 comments on commit 7012c96

Please sign in to comment.