Skip to content

Commit c58c687

Browse files
authored
Merge pull request #196 from crazy-max/check-status
Check desired output status
2 parents 5b4307d + 25af97b commit c58c687

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: ci
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- master
@@ -211,6 +212,7 @@ jobs:
211212
uses: docker/setup-buildx-action@v1
212213
-
213214
name: Build
215+
id: docker_build
214216
continue-on-error: true
215217
uses: ./
216218
with:
@@ -219,6 +221,14 @@ jobs:
219221
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
220222
push: true
221223
tags: localhost:5000/name/app:latest
224+
-
225+
name: Check
226+
run: |
227+
echo "${{ toJson(steps.docker_build) }}"
228+
if [ "${{ steps.docker_build.outcome }}" != "failure" ] || [ "${{ steps.docker_build.conclusion }}" != "success" ]; then
229+
echo "::error::Should have failed"
230+
exit 1
231+
fi
222232
-
223233
name: Dump context
224234
if: always()
@@ -243,13 +253,25 @@ jobs:
243253
uses: actions/checkout@v2.3.3
244254
-
245255
name: Build
256+
id: docker_build
246257
continue-on-error: ${{ matrix.push }}
247258
uses: ./
248259
with:
249260
context: ./test
250261
file: ./test/Dockerfile
251262
push: ${{ matrix.push }}
252263
tags: localhost:5000/name/app:latest
264+
-
265+
name: Check
266+
run: |
267+
echo "${{ toJson(steps.docker_build) }}"
268+
if [ "${{ matrix.push }}" = "false" ]; then
269+
exit 0
270+
fi
271+
if [ "${{ steps.docker_build.outcome }}" != "failure" ] || [ "${{ steps.docker_build.conclusion }}" != "success" ]; then
272+
echo "::error::Should have failed"
273+
exit 1
274+
fi
253275
-
254276
name: Dump context
255277
if: always()

0 commit comments

Comments
 (0)