1
0
mirror of https://github.com/home-assistant/operating-system.git synced 2026-02-15 07:29:08 +00:00

Add a flag to determine tests were called from another workflow (#2887)

If a reusable workflow is called from another workflow, the event_type
in the child workflow is still the same as parent's. This is a known
"feature": https://github.com/actions/runner/discussions/1884

Add a flag to inputs that has default value set to true. This is in turn
set only if the workflow is called from another one, chosing the correct
step for obtaining the OS image.
This commit is contained in:
Jan Čermák
2023-10-31 10:12:37 +01:00
committed by GitHub
parent d39a767bfb
commit 54cab43ea3

View File

@@ -12,6 +12,13 @@ on:
# Called by other workflows (e.g. build.yaml)
workflow_call:
inputs:
use-artifact:
# Workaround for GH weirdness: https://github.com/actions/runner/discussions/1884
description: Download OS image using actions/download-artifact
required: false
type: boolean
default: true
jobs:
test:
@@ -43,12 +50,12 @@ jobs:
pip install -r tests/requirements.txt
- name: Download HAOS image
if: ${{ github.event_name == 'workflow_dispatch' }}
if: ${{ inputs.use-artifact }}
run: |
curl -sfL -o haos.qcow2.xz https://os-artifacts.home-assistant.io/${{github.event.inputs.version}}/haos_ova-${{github.event.inputs.version}}.qcow2.xz
- name: Get OS image artifact
if: ${{ github.event_name == 'workflow_call' }}
if: ${{ !inputs.use-artifact }}
uses: actions/download-artifact@v3
with:
name: ova-image