diff --git a/.github/actions/parse-context-array/action.yml b/.github/actions/parse-context-array/action.yml index a9a82e1..0e9dc12 100644 --- a/.github/actions/parse-context-array/action.yml +++ b/.github/actions/parse-context-array/action.yml @@ -1,6 +1,10 @@ name: parse-context-array description: Parse Context Array +inputs: + step-two-exit-code: + required: true + runs: using: composite steps: @@ -12,27 +16,24 @@ runs: - name: step two id: step-two shell: bash - run: exit 0 + run: exit ${{ inputs.step-two-exit-code }} - - name: Evaluate job one status + - name: Echo job statuses if: always() shell: bash run: | - echo $STEP_OUTCOMES - env: - STEP_OUTCOMES: ${{ steps.step-one.outcome }} + echo ${{ steps.step-one.outcome }} + echo ${{ steps.step-two.outcome }} - name: Evaluate job status if: always() shell: bash run: | - if [ $STEP_OUTCOMES =~ "failure" ]; then + if [[ ${{ join(steps.*.outcome, ',') }} =~ "failure" ]]; then echo JOB_STATUS="failure" >> $GITHUB_ENV; else echo JOB_STATUS="success" >> $GITHUB_ENV; fi; - env: - STEP_OUTCOMES: ${{ join(steps.*.outcome, ',') }} - name: Report job status if: always() diff --git a/.github/workflows/parse-context-array.yml b/.github/workflows/parse-context-array.yml index c903242..7ef86ee 100644 --- a/.github/workflows/parse-context-array.yml +++ b/.github/workflows/parse-context-array.yml @@ -1,6 +1,12 @@ name: ParseContextArray -on: [push] +on: + workflow_dispatch: + inputs: + step-two-exit-code: + type: number + default: 0 + push: jobs: test: @@ -12,3 +18,5 @@ jobs: - name: Parse Context Array uses: ./.github/actions/parse-context-array/ + with: + step-two-exit-code: ${{ github.event.inputs.step-two-exit-code }}