Skip to content

Commit 095332c

Browse files
committed
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 <[email protected]>
1 parent 269fcc4 commit 095332c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/actions/setup/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ inputs:
77
runs:
88
using: composite
99
steps:
10+
- name: Verify requirements.txt for "actions/setup-python" with enabled "pip" cache
11+
shell: bash
12+
run: |
13+
if [ ! -f "requirements.txt" ]; then
14+
echo "python-gardenlinux-lib @ git+https://github.com/gardenlinux/python-gardenlinux-lib.git@${{ inputs.version }}" | tee -a requirements.txt
15+
fi
1016
- name: Set up Python 3.13
1117
uses: actions/setup-python@v5
1218
with:

0 commit comments

Comments
 (0)