From f718030e6c12a8f93ec7e423efa0dfd115046091 Mon Sep 17 00:00:00 2001 From: abaudet Date: Sat, 9 Jan 2021 23:45:50 +0400 Subject: [PATCH] ci(release) Add input on build workflow to prevent deploy --- .github/workflows/build.yml | 9 +++++++-- .github/workflows/generate-documentation.yml | 4 ++-- .github/workflows/release.yml | 5 ++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63c1197a7c..5a318bd93f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,7 +5,12 @@ on: branches-ignore: - 'gh-*' - 'docs/**' - workflow_dispatch: + workflow_dispatch: + inputs: + deploy: + description: 'Deploy on Maven repository' + required: true + default: false jobs: build: @@ -471,7 +476,7 @@ jobs: fail_on_test_failures: true deploy: - if: github.ref == 'refs/heads/master' + if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == true) needs: [classpath-tests-standalone, classpath-tests-spring-boot-legacy, classpath-tests-spring-boot, javadoc, analyze-sonar, analyze-codecov] runs-on: ubuntu-18.04 name: "Deploy" diff --git a/.github/workflows/generate-documentation.yml b/.github/workflows/generate-documentation.yml index 4641de1795..93f52140e8 100644 --- a/.github/workflows/generate-documentation.yml +++ b/.github/workflows/generate-documentation.yml @@ -129,7 +129,7 @@ jobs: token: ${{ secrets.DEV_REPORTS_GITHUB_TOKEN }} - name: "Add branch site to reports" run: | - BRANCH="${GITHUB_REF#refs/heads}" + BRANCH="${GITHUB_REF#refs/heads/}" ci/./deploy-dev-reports.sh $BRANCH ${{ github.workspace }}/ogham-dev-reports slack-success: @@ -138,7 +138,7 @@ jobs: runs-on: ubuntu-18.04 name: "Slack" steps: - - run: echo "BRANCH=${GITHUB_REF#refs/heads}" >> $GITHUB_ENV + - run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV - uses: 8398a7/action-slack@v3 with: text: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a16ee97c7d..25c6d5b737 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -119,13 +119,16 @@ jobs: needs: [release] runs-on: ubuntu-18.04 steps: - - run: echo "disabled" - uses: aurelien-baudet/workflow-dispatch@v2 with: token: ${{ secrets.TRIGGER_WORKFLOW_TOKEN }} workflow: build.yml wait-for-completion-interval: 10m wait-for-completion-timeout: 4h + inputs: | + { + "deploy": false + } deploy-release: needs: [test-release]