diff --git a/.github/workflows/production_deploy.js.yml b/.github/workflows/production_deploy.js.yml index fa69c46..066e78f 100644 --- a/.github/workflows/production_deploy.js.yml +++ b/.github/workflows/production_deploy.js.yml @@ -10,8 +10,17 @@ jobs: - name: Do some magic run: echo magic + - name: Get lastest draft release + id: get_latest_draft_release + run: | + echo "::set-output name=DRAFT_RELEASE::$(gh release list -L 1 -R \$OWNER/\$REPO | grep Draft)" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + OWNER: ${{ env.GITHUB_REPOSITORY_OWNER }} + REPO: ${{ env.GITHUB_REPOSITORY }} + - uses: release-drafter/release-drafter@v5 - if: ${{ github.ref == 'refs/heads/main' }} + if: ${{ github.ref == 'refs/heads/main' && steps.get_latest_release.outputs.DRAFT_RELEASE }} with: config-name: release_drafter.yml disable-autolabeler: false