Skip to content

Commit 47796cf

Browse files
committed
fix(action): resolve action_path to absolute path before setup-python
github.action_path returns '.' in owner's own repo, causing invalid pattern error in setup-python cache-dependency-path. Resolve to absolute path first via a shell step.
1 parent 454cd6c commit 47796cf

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

action.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,28 @@ outputs:
3838
runs:
3939
using: "composite"
4040
steps:
41+
- name: Resolve action absolute path
42+
id: action-path
43+
shell: bash
44+
run: echo "abs=$(cd '${{ github.action_path }}' && pwd)" >> "$GITHUB_OUTPUT"
45+
4146
- name: Set up Python
4247
uses: actions/setup-python@v5
4348
with:
4449
python-version: ${{ inputs.python-version }}
4550
cache: "pip"
46-
cache-dependency-path: "${{ github.action_path }}/requirements.txt"
51+
cache-dependency-path: "${{ steps.action-path.outputs.abs }}/requirements.txt"
4752

4853
- name: Install dependencies
4954
shell: bash
5055
run: |
5156
python -m pip install --upgrade pip
52-
pip install -r ${{ github.action_path }}/requirements.txt
57+
pip install -r ${{ steps.action-path.outputs.abs }}/requirements.txt
5358
5459
- name: Create runtime .env for script
5560
shell: bash
5661
run: |
57-
cp ${{ github.action_path }}/.env.example .env
62+
cp ${{ steps.action-path.outputs.abs }}/.env.example .env
5863
printf "\nWAKA_API=%s\n" "${{ inputs.waka-api }}" >> .env
5964
printf "WAKA_TOKEN=%s\n" "${{ inputs.waka-token }}" >> .env
6065
printf "BAR_STYLE=%s\n" "${{ inputs.bar-style }}" >> .env

0 commit comments

Comments
 (0)