Skip to content

Commit f3d2210

Browse files
committed
Fix use container if rebuilt on PR
1 parent f96f9c3 commit f3d2210

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/ci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ jobs:
5757
|| startsWith(github.ref, 'refs/tags/'))
5858
needs: [ changes, container ]
5959
uses: ./.github/workflows/outputs.yml
60+
with:
61+
container: ${{ needs.changes.outputs.container == 'true' }}

.github/workflows/outputs.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Generate outputs
22
on:
33
workflow_call:
4+
inputs:
5+
container:
6+
required: true
7+
type: boolean
48

59
jobs:
610
re-generate:
@@ -39,15 +43,15 @@ jobs:
3943
ref: ${{ github.event.pull_request.head.ref }}
4044
repository: ${{ github.event.pull_request.head.repo.full_name }}
4145

42-
- name: Download container from artifact if PR
43-
if: github.event_name == 'pull_request' && needs.container.result == 'success'
46+
- name: Download container if was previously created
47+
if: github.event_name == 'pull_request' && inputs.container
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.container
5155
run: |
5256
docker load --input /tmp/tutorial-container.tar
5357
docker image ls -a

0 commit comments

Comments
 (0)