From c3acfd21f92ceb3478180399d364e5ddc58b287a Mon Sep 17 00:00:00 2001 From: "awf-autoware-bot[bot]" <94889083+awf-autoware-bot[bot]@users.noreply.github.com> Date: Tue, 3 May 2022 13:37:13 +0900 Subject: [PATCH] chore: sync files (#32) Signed-off-by: GitHub Co-authored-by: kenji-miyake --- .github/workflows/github-release.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/github-release.yaml b/.github/workflows/github-release.yaml index 7bb9d7093..23508e63b 100644 --- a/.github/workflows/github-release.yaml +++ b/.github/workflows/github-release.yaml @@ -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 }}" \