From 24f54680f87cd22a87393dc9c0f32c8659ac7636 Mon Sep 17 00:00:00 2001 From: Kirill Bobyrev Date: Fri, 1 Oct 2021 08:32:13 +0200 Subject: [PATCH] Allow keeping the workflow dispatch release as drafts This is useful for testing the release before publishing (something we might need for newly released 13.0.0). Also, clean up `${{}}` in `if`s, apparently they are not needed (even though they are used throughout the documentation): https://docs.github.com/en/actions/learn-github-actions/expressions#about-expressions --- .github/workflows/autobuild.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/autobuild.yaml b/.github/workflows/autobuild.yaml index 5b50e69..ab12fbc 100644 --- a/.github/workflows/autobuild.yaml +++ b/.github/workflows/autobuild.yaml @@ -27,11 +27,14 @@ on: description: description: 'Release description' required: true + keep_as_draft: + description: 'Put "true" to avoid publishing the release' + required: false jobs: schedule_environment: name: Create default build environment runs-on: ubuntu-latest - if: ${{ github.event_name == 'schedule' }} + if: github.event_name == 'schedule' steps: - name: Install deps run: | @@ -75,7 +78,7 @@ jobs: workflow_dispatch_environment: name: Use inputs to create build environment runs-on: ubuntu-latest - if: ${{ github.event_name == 'workflow_dispatch' }} + if: github.event_name == 'workflow_dispatch' steps: - name: Use repo and commit from the inputs run: | @@ -318,7 +321,7 @@ jobs: finalize: runs-on: ubuntu-latest needs: build - if: always() && needs.build.result == 'success' + if: always() && needs.build.result == 'success' && !(github.event_name == 'workflow_dispatch' && github.event.inputs.keep_as_draft == 'true') steps: - name: Fetch release info uses: actions/download-artifact@v1