Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Use RUNNER_TEMP as TMPDIR #218

Open
andrewthetechie opened this issue Jul 25, 2022 · 0 comments
Open

Use RUNNER_TEMP as TMPDIR #218

andrewthetechie opened this issue Jul 25, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@andrewthetechie
Copy link

Motivation

On our selfhosted github actions runners, the action fails because we have /tmp mounted noexec, a security requirement.

To use rustup manually on the instance, we could use the TMPDIR env var to define an alternative temporary directory

TMPDIR=/opt/tmp rustup.sh

On a runner, there's an env var RUNNER_TEMP that is a temporary directory for this run. In workflow example, I show how we use this to work around our noexec setting on tmp.

It would be great if the workflow could just use RUNNER_TEMP by default. Setting the environment variable TMPDIR equal to RUNNER_TEMP should be enough to make this work automatically.

Workflow example

jobs:
  tests:
    name: Lint and test
    runs-on: [self-hosted]
    steps:
      - name: Check out the repository
        uses: actions/checkout@v3.0.2
      - name: Setup rust
        uses: actions-rs/toolchain@v1
        env:
          TMPDIR: ${{ runner.temp }}
@andrewthetechie andrewthetechie added the enhancement New feature or request label Jul 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant