frenck / action-home-assistant

🚀 Frenck's GitHub Action for running a Home Assistant Core configuration check
MIT License
48 stars 5 forks source link

Compatibility with Gitea Act Runner #101

Open alex3305 opened 1 month ago

alex3305 commented 1 month ago

Hi Frenck 👋,

I've been trying to get this action working with Gitea Act Runner but it seems like something is off when running it on Act runner. I suspect it is the volume mount based on pwd here: https://github.com/frenck/action-home-assistant/blob/7ef7214b6cc2a865918e555256a65153b741347c/action.yaml#L114 which seems to work on GitHub Actions, but not on Gitea. As I get the following error (snippet):

[...]
expression 'format('docker run --rm \\n  --entrypoint "" \\n  "ghcr.io/home-assistant/home-assistant:{0}" \\n    python -m homeassistant --version\nenv_file_arg=""\nif [[ -f "{1}" ]]; then\n  env_file_arg="--env-file {2}"\nfi\ndocker run --rm \\n  --entrypoint "" \\n  -v $(pwd):/github/workspace \\n  $env_file_arg \\n  --workdir /github/workspace \\n  "ghcr.io/home-assistant/home-assistant:{3}" \\n    python -m homeassistant \\n      --config "{4}" \\n      --script check_config\n', steps.version.outputs.version, inputs.env_file, inputs.env_file, steps.version.outputs.version, steps.check.outputs.path)' evaluated to '%!t(string=docker run --rm \\n  --entrypoint "" \\n  "ghcr.io/home-assistant/home-assistant:stable" \\n    python -m homeassistant --version\nenv_file_arg=""\nif [[ -f "" ]]; then\n  env_file_arg="--env-file "\nfi\ndocker run --rm \\n  --entrypoint "" \\n  -v $(pwd):/github/workspace \\n  $env_file_arg \\n  --workdir /github/workspace \\n  "ghcr.io/home-assistant/home-assistant:stable" \\n    python -m homeassistant \\n      --config "/workspace/homeassistant/config" \\n      --script check_config\n)'
Wrote command \n\ndocker run --rm \\n  --entrypoint "" \\n  "ghcr.io/home-assistant/home-assistant:stable" \\n    python -m homeassistant --version\nenv_file_arg=""\nif [[ -f "" ]]; then\n  env_file_arg="--env-file "\nfi\ndocker run --rm \\n  --entrypoint "" \\n  -v $(pwd):/github/workspace \\n  $env_file_arg \\n  --workdir /github/workspace \\n  "ghcr.io/home-assistant/home-assistant:stable" \\n    python -m homeassistant \\n      --config "/workspace/homeassistant/config" \\n      --script check_config\n\n\n to 'workflow/5-composite-4.sh'
Writing entry to tarball workflow/5-composite-4.sh len:478
Extracting content to '/var/run/act'
  🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/5-composite-4.sh] user= workdir=
Exec command '[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/5-composite-4.sh]'
Working directory '/workspace/homeassistant/config'
2024.8.1
Testing configuration at /workspace/homeassistant/config
Failed config
  General Errors: 
    - File configuration.yaml not found.
Successful config (partial)
  ❌  Failure - Main 🚀 Run Home Assistant Configuration Check
exitcode '1': failure
  ❌  Failure - Main Run Home Assistant Configuration Check
exitcode '1': failure
evaluating expression 'always()'
expression 'always()' evaluated to 'true'
[...]

However as you can see, Act Runner checks out in /workspace/homeassistant/config which is the same as $GITHUB_WORKSPACE. However on GitHub Actions this just works™ 🤷 . I've looked into setting the path on the Action itself, but that's only a relative path to $GITHUB_WORKSPACE. So I guess this is useless.

So in general I was wondering what your stance is on compatibility with Gitea runner? I assume that it isn't a part of your stack and you don't want to invest any time in it. But would you be open for PR's regarding this?

Thanks ❤️