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
This commit is contained in:
Ayaz Salikhov
2025-02-17 19:42:00 +00:00
committed by GitHub
parent f3a92fadb7
commit 3fc8373f13
2 changed files with 15 additions and 3 deletions

View File

@@ -18,6 +18,13 @@ on:
- "docs/using/recipe_code/**"
workflow_dispatch:
workflow_call:
inputs:
# There is no good way to detect if the workflow was called using workflow_call
# https://github.com/actions/runner/discussions/1884
called-using-workflow-call:
description: "Was the workflow called using workflow_call"
required: true
type: boolean
jobs:
generate-matrix:
@@ -44,7 +51,7 @@ jobs:
uses: actions/checkout@v4
- name: Load image to Docker 📥
if: ${{ github.event_name == 'workflow_call' && matrix.parent-image != '' }}
if: ${{ inputs.called-using-workflow-call && matrix.parent-image != '' }}
uses: ./.github/actions/load-image
with:
image: ${{ matrix.parent-image }}

View File

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