diff --git a/.gitea/workflows/homelab-main.yml b/.gitea/workflows/homelab-main.yml index b4dfdc4..90199c1 100644 --- a/.gitea/workflows/homelab-main.yml +++ b/.gitea/workflows/homelab-main.yml @@ -14,15 +14,14 @@ jobs: - name: Install Node.js and Python deps run: | set -e - # We avoid apt-get update/install for tools already in the image or easily fetched - # Python3 and curl are already in golang:1.23-bullseye. - # We only need python3-yaml and nodejs. - # To avoid broken debian-security mirrors, we use pip for yaml and binary for node. + # Use python3 -m pip to ensure we use the python3 installed in the image + python3 -m pip install --user PyYAML - pip3 install PyYAML + # Update PATH to include user pip installs + export PATH="${PATH}:${HOME}/.local/bin" curl -fsSL https://deb.nodesource.com/setup_18.x | bash - - apt-get install -y --no-install-recommends nodejs + apt-get update && apt-get install -y --no-install-recommends nodejs - name: Check out repository run: | set -e @@ -30,6 +29,8 @@ jobs: - name: Validate repository run: | set -e + # Ensure user pip path is available for the script + export PATH="${PATH}:${HOME}/.local/bin" ./jeannie validate deploy: @@ -42,9 +43,10 @@ jobs: - name: Install Node.js and Python deps run: | set -e - pip3 install PyYAML + python3 -m pip install --user PyYAML + export PATH="${PATH}:${HOME}/.local/bin" curl -fsSL https://deb.nodesource.com/setup_18.x | bash - - apt-get install -y --no-install-recommends nodejs + apt-get update && apt-get install -y --no-install-recommends nodejs - name: Check out repository run: | set -e @@ -52,6 +54,7 @@ jobs: - name: Block automatic deploy for external Gitea changes run: | set -e + export PATH="${PATH}:${HOME}/.local/bin" event_before="$( python3 -c 'import json, os; p = os.environ.get("GITHUB_EVENT_PATH", ""); print(json.load(open(p, encoding="utf-8")).get("before", "") if p and os.path.exists(p) else "")'