Skip to content

Commit ba79473

Browse files
committed
Swap container check to use inputs
1 parent 4d9b04a commit ba79473

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
|| startsWith(github.ref, 'refs/tags/'))
6060
needs: [ changes, container ]
6161
uses: ./.github/workflows/outputs.yml
62+
with:
63+
with_pr_container: ${{ needs.container.result }}
6264

6365
style:
6466
if: ${{ needs.changes.outputs.style == 'true' }}

.github/workflows/outputs.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Generate outputs
22
on:
33
workflow_call:
4+
inputs:
5+
with_pr_container:
6+
required: true
7+
type: string
48

59
jobs:
610
re-generate:
@@ -40,14 +44,14 @@ jobs:
4044
repository: ${{ github.event.pull_request.head.repo.full_name }}
4145

4246
- name: Download container from artifact if PR
43-
if: github.event_name == 'pull_request' && needs.container.result == 'success'
47+
if: github.event_name == 'pull_request' && inputs.with_pr_container == 'true'
4448
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
4549
with:
4650
name: tutorial-container
4751
path: /tmp
4852

4953
- name: Import container from PR artifact
50-
if: github.event_name == 'pull_request' && needs.container.result == 'success'
54+
if: github.event_name == 'pull_request' && inputs.with_pr_container == 'true'
5155
run: |
5256
docker load --input /tmp/tutorial-container.tar
5357
docker image ls -a

0 commit comments

Comments
 (0)