From b66bde54a6ae02020c66728e2c4697609401b3bb Mon Sep 17 00:00:00 2001 From: Marcin Stachniuk Date: Tue, 24 Nov 2020 22:40:04 +0100 Subject: [PATCH] Another way --- action.yml | 10 ++++++++-- script.sh | 9 ++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index ae8b6d4..67f953a 100644 --- a/action.yml +++ b/action.yml @@ -24,12 +24,18 @@ inputs: outputs: ci-skip: description: 'The output ci-skip with the value true/false, default: false' - value: 'false' + value: ${{ steps.set-outputs-step.outputs.skip }} ci-skip-not: description: 'The output ci-skip-not with the value true/false, default: true' - value: 'true' + value: ${{ steps.set-outputs-step.outputs.skip-not }} runs: using: "composite" steps: - run: $GITHUB_ACTION_PATH/script.sh "${{ inputs.fail-fast }}" "${{ inputs.exit-code }}" "${{ inputs.commit-filter }}" "${{ inputs.commit-filter-separator }}" shell: bash + - id: set-outputs-step + run: | + echo "::set-output name=skip::${{ CI_SKIP }}" + echo "::set-output name=skip-not::${{ CI_SKIP_NOT }}" + shell: bash + diff --git a/script.sh b/script.sh index 9d2b187..48fe816 100755 --- a/script.sh +++ b/script.sh @@ -1,4 +1,3 @@ -set -x fail_fast=$1 exit_code=$2 @@ -30,8 +29,8 @@ if [[ "$total_filter_count" -eq 0 ]]; then echo "CI_SKIP_NOT=true" echo "CI_SKIP=false" >> $GITHUB_ENV echo "CI_SKIP_NOT=true" >> $GITHUB_ENV - echo "::set-output name=ci-skip::false" - echo "::set-output name=ci-skip-not::true" +# echo "::set-output name=ci-skip::false" +# echo "::set-output name=ci-skip-not::true" echo "And continue..." else if [[ $fail_fast == 'true' ]]; then @@ -44,8 +43,8 @@ else echo "CI_SKIP_NOT=false" echo "CI_SKIP=true" >> $GITHUB_ENV echo "CI_SKIP_NOT=false" >> $GITHUB_ENV - echo "::set-output name=ci-skip::true" - echo "::set-output name=ci-skip-not::false" +# echo "::set-output name=ci-skip::true" +# echo "::set-output name=ci-skip-not::false" echo "And continue..." fi fi