Skip to content

Commit 3fc8373

Browse files
authored
Enable building contributed recipes in PRs (#2213)
* Enable building contributed recipes in PRs * Add some steps * Simplify contributed-recipes requirements * Do not use github.event_name * Make a variable required * Better text
1 parent f3a92fa commit 3fc8373

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.github/workflows/contributed-recipes.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ on:
1818
- "docs/using/recipe_code/**"
1919
workflow_dispatch:
2020
workflow_call:
21+
inputs:
22+
# There is no good way to detect if the workflow was called using workflow_call
23+
# https://github.com/actions/runner/discussions/1884
24+
called-using-workflow-call:
25+
description: "Was the workflow called using workflow_call"
26+
required: true
27+
type: boolean
2128

2229
jobs:
2330
generate-matrix:
@@ -44,7 +51,7 @@ jobs:
4451
uses: actions/checkout@v4
4552

4653
- name: Load image to Docker 📥
47-
if: ${{ github.event_name == 'workflow_call' && matrix.parent-image != '' }}
54+
if: ${{ inputs.called-using-workflow-call && matrix.parent-image != '' }}
4855
uses: ./.github/actions/load-image
4956
with:
5057
image: ${{ matrix.parent-image }}

.github/workflows/docker.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,5 +494,10 @@ jobs:
494494

495495
contributed-recipes:
496496
uses: ./.github/workflows/contributed-recipes.yml
497-
needs: [merge-tags]
498-
if: github.ref == 'refs/heads/main' || github.event_name == 'schedule'
497+
with:
498+
called-using-workflow-call: true
499+
# Contributed recipes only use these images
500+
# If recipes using other images will be added, they should be added here as well
501+
#
502+
# contributed-recipes will give an error if the image is not yet built and uploaded
503+
needs: [aarch64-base, x86_64-base, aarch64-minimal, x86_64-minimal]

0 commit comments

Comments
 (0)