From 500e03c781b3f89da9850d9ad643519681415b7d Mon Sep 17 00:00:00 2001 From: Tobias Wolf Date: Wed, 11 Jun 2025 10:21:14 +0200 Subject: [PATCH] Fix GH action `setup` to allow "setup-python" with `pip` cache enabled This commit fixes an issue with "setup-python" expecting a `requirements.txt` for hashing if dependency caching like `pip` is enabled. This action should be callable in workflows even if such a file does not exist. Therefore we create it manually. Signed-off-by: Tobias Wolf --- .github/actions/setup/action.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 816f2801..2e7eb29e 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -7,6 +7,12 @@ inputs: runs: using: composite steps: + - name: Verify requirements.txt for "actions/setup-python" with enabled "pip" cache + shell: bash + run: | + if [ ! -f "requirements.txt" ]; then + echo "python-gardenlinux-lib @ git+https://github.com/gardenlinux/python-gardenlinux-lib.git@${{ inputs.version }}" | tee -a requirements.txt + fi - name: Set up Python 3.13 uses: actions/setup-python@v5 with: