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

Use RUNNER_TEMP as TMPDIRΒ #218

@andrewthetechie

Description

@andrewthetechie

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/[email protected]
      - name: Setup rust
        uses: actions-rs/toolchain@v1
        env:
          TMPDIR: ${{ runner.temp }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions