From 1b6a9efdd82beb560720907e9fa5c55e54da4735 Mon Sep 17 00:00:00 2001 From: Nanne Date: Sun, 16 Jan 2022 19:08:25 +0100 Subject: [PATCH] Support optional env_file input (#47) Co-authored-by: Franck Nijhof --- action.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/action.yaml b/action.yaml index eb5c624..611d0fd 100644 --- a/action.yaml +++ b/action.yaml @@ -18,6 +18,9 @@ inputs: version: description: Version to use; dev/beta/stable or a specific version number required: false + env_file: + description: Possible path to environment file to use + required: false runs: using: "composite" @@ -102,10 +105,14 @@ runs: --entrypoint "" \ "ghcr.io/home-assistant/home-assistant:${{ steps.version.outputs.version }}" \ python -m homeassistant --version - + env_file_arg="" + if [[ -f "${{ inputs.env_file }}" ]]; then + env_file_arg="--env-file ${{ inputs.env_file }}" + fi docker run --rm \ --entrypoint "" \ -v $(pwd):/github/workspace \ + $env_file_arg \ --workdir /github/workspace \ "ghcr.io/home-assistant/home-assistant:${{ steps.version.outputs.version }}" \ python -m homeassistant \