maxim-lobanov / setup-xcode

Set up your GitHub Actions workflow with a specific version of Xcode
MIT License
280 stars 28 forks source link

Export DEVELOPER_DIR instead of invoking xcode-select to set the active Xcode version #62

Open bobergj opened 1 year ago

bobergj commented 1 year ago

Export the DEVELOPER_DIR environment variable instead of invoking xcode-select to set the active Xcode version.

Setting the active Xcode version with sudo xcode-select changes the setting system wide. Github actions can also be run with a self-hosted runner: https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners. When using a self-hosted github runner, the run isn't necessarily containerized. Changing the system-wide Xcode version then creates conflicts between concurrent runs.

From man xcode-select:

ENVIRONMENT DEVELOPER_DIR Overrides the active developer directory. When DEVELOPER_DIR is set, its value will be used instead of the system-wide active developer directory.