fix: set composite outputs on failure (#945)

fix: conclusion and outcome after error with failure condition
fix: continue-on-error doesn't work correctly for composite actions
This commit is contained in:
ChristopherHX
2022-01-21 17:08:30 +01:00
committed by GitHub
parent eba71f98fe
commit 4be9062dd2
5 changed files with 32 additions and 5 deletions

View File

@@ -0,0 +1,13 @@
outputs:
customoutput:
value: my-customoutput-${{ steps.random-color-generator.outputs.SELECTED_COLOR }}
runs:
using: composite
steps:
- name: Set selected color
run: echo '::set-output name=SELECTED_COLOR::green'
id: random-color-generator
shell: bash
- name: fail
run: exit 1
shell: bash

View File

@@ -0,0 +1,14 @@
name: composite-fail-with-output
on: push
jobs:
test-for-output:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./actions/composite-fail-with-output
id: composite-fail-with-output
continue-on-error: true
- run: |
echo ${{steps.composite-fail-with-output.outputs.customoutput}}
exit ${{steps.composite-fail-with-output.outputs.customoutput == 'my-customoutput-green' && '0' || '1'}}