-
Notifications
You must be signed in to change notification settings - Fork 654
Description
Description:
When setup-python is used in a downstream composite action, we would want it to pick up the requirements.txt from the composite action files instead of the current GITHUB_WORKSPACE.
This is currently not possible and setup-python ends up giving an error: Error: No file in /home/ubuntu/actions-runner/_work/ matched to [**/requirements.txt or **/pyproject.toml], make sure you have checked out the target repository.
Ideally, as the composite action requires the python set up, we should also have the ability to look for the requirements.txt file in /home/ubuntu/actions-runner/_action
.
The glob.hashFiles function that is called by setup-python does provide an option for current workspace: https://github.com/actions/toolkit/blob/f58042f9cc16bcaa87afaa86c2974a8c771ce1ea/packages/glob/src/internal-hash-files.ts#L9.
This issue can potentially be fixed by taking in an input for the workspace to look for the requirements.txt file. It can then be provided from the composite action as ${{ github.action_path }}.
Action version:
v6
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted
- Self-hosted
Tools version:
Using Python 3.13
Repro steps:
- Have a workflow in a repository that does not deal with python and therefore does not have
requirements.txt
orpyproject.toml
- Use a composite github action from another repository that requires python to perform its operations and has a requirements.txt
- Provide the complete path to this requirements.txt or **/requirements.txt in the
cache-dependency-path
input
Expected behavior:
The setup-python should pickup the requirements.txt from the _action
directory and complete successfully
Actual behavior:
Setup python errors with Error: No file in /home/ubuntu/actions-runner/_work/<redacted> matched to [**/requirements.txt or **/pyproject.toml], make sure you have checked out the target repository.