From b58c44f113d39df6a5a28ce66c58637e7f83053d Mon Sep 17 00:00:00 2001 From: Gabriel Feo Date: Thu, 25 May 2023 17:52:43 +0100 Subject: [PATCH 1/2] Fix dry-run logic in build action --- .github/actions/build/action.yml | 2 +- .github/workflows/publish-javadoc.yml | 4 ++-- .github/workflows/publish-library.yml | 4 ++-- .github/workflows/update-api-spec.yml | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index bd0c37c9b..b5518d72b 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -35,7 +35,7 @@ runs: gradle ${{ inputs.args }} fi - name: Upload - if: ${{ inputs.path-to-upload && !inputs.dry-run }} + if: ${{ inputs.path-to-upload && inputs.dry-run != true }} uses: actions/upload-artifact@v3.0.0 with: name: ${{ inputs.artifact-name }} diff --git a/.github/workflows/publish-javadoc.yml b/.github/workflows/publish-javadoc.yml index 0c9c9eacb..285fc5a72 100644 --- a/.github/workflows/publish-javadoc.yml +++ b/.github/workflows/publish-javadoc.yml @@ -8,13 +8,13 @@ on: dry_run: description: 'Dry run' type: boolean - required: false + default: false workflow_call: inputs: dry_run: description: 'Dry run' type: boolean - required: true + default: false defaults: run: diff --git a/.github/workflows/publish-library.yml b/.github/workflows/publish-library.yml index 668c97c5f..9d250d1c8 100644 --- a/.github/workflows/publish-library.yml +++ b/.github/workflows/publish-library.yml @@ -8,13 +8,13 @@ on: dry_run: description: 'Dry run' type: boolean - required: false + default: false workflow_call: inputs: dry_run: description: 'Dry run' type: boolean - required: true + default: false defaults: run: diff --git a/.github/workflows/update-api-spec.yml b/.github/workflows/update-api-spec.yml index b55ac8118..eb9ef0367 100644 --- a/.github/workflows/update-api-spec.yml +++ b/.github/workflows/update-api-spec.yml @@ -8,13 +8,13 @@ on: dry_run: description: 'Dry run' type: boolean - required: false + default: false workflow_call: inputs: dry_run: description: 'Dry run' type: boolean - required: true + default: false defaults: run: @@ -34,7 +34,7 @@ jobs: fi rm new.txt || true - name: 'Create PR' - if: ${{ !inputs.dry_run && env.NEW_VERSION }} + if: ${{ inputs.dry_run != true && env.NEW_VERSION }} uses: peter-evans/create-pull-request@v5 with: branch: "feature/api-spec-${{ env.NEW_VERSION }}" From 72be7cc2b9cfd58a09de113b738a2a4c5a6591d5 Mon Sep 17 00:00:00 2001 From: Gabriel Feo Date: Thu, 25 May 2023 20:42:01 +0100 Subject: [PATCH 2/2] Let dry-run upload artifacts --- .github/actions/build/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index b5518d72b..4cde9ae58 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -35,9 +35,9 @@ runs: gradle ${{ inputs.args }} fi - name: Upload - if: ${{ inputs.path-to-upload && inputs.dry-run != true }} + if: ${{ inputs.path-to-upload }} uses: actions/upload-artifact@v3.0.0 with: name: ${{ inputs.artifact-name }} path: ${{ inputs.path-to-upload }} - if-no-files-found: error + if-no-files-found: warn