actions / setup-python

Set up your GitHub Actions workflow with a specific version of Python
MIT License
1.71k stars 545 forks source link

Forced to use /Users/runner for hostedtoolscache; need a way to override #974

Open NorseGaud opened 13 hours ago

NorseGaud commented 13 hours ago

https://github.com/actions/setup-python/blob/0b93645e9fea7318ecaed2b359559ac225c90a2b/src/setup-python.ts#L81

Requesting that there be a way to override /Users/runner to avoid"

Run actions/setup-python@v5
Installed versions
  Version 3.9 was not found in the local cache
  Version 3.9 is available for downloading
  Download from "https://github.com/actions/python-versions/releases/download/3.9.13-11183687820/python-3.9.13-darwin-arm64.tar.gz"
  Extract downloaded archive
  /usr/bin/tar xz -C /Users/anka/actions-runner/_work/_temp/88d733fe-3d68-4222-bfad-274b280a0c83 -f /Users/anka/actions-runner/_work/_temp/084fd4fb-7571-406e-99db-04b625fe9363
  Execute installation script
  Check if Python hostedtoolcache folder exist...
  Creating Python hostedtoolcache folder...
  Error: mkdir: /Users/runner: Permission denied
  Error: The process '/bin/bash' failed with exit code 1

Our macOS machines are not created with the runner user.

NorseGaud commented 13 hours ago

I tried setting env: in the yaml but that doesn't work. Maybe someone has an example?