Skip to content

Clean self-hosted runner

Actions
Clean working directory on self-hosted runners
v1.3.26
Latest
Verified creator
Star (4)

Tags

 (1)

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

clean-self-hosted-runner

GitHub Actions to clean the working directory on self hosted runners

Release

Per the official documentation, self-hosted runners don't need to have a clean instance for every job execution. Your job might however need a clean working directory for every execution.

The goal of this action is to clean the working directory at the beginning or the end of each job.

Usage

steps:
  - uses: eviden-actions/clean-self-hosted-runner@v1

Options

To disable the cleanup job (e.g. for debugging purpose), set the environment variable DISABLE_RUNNER_CLEANUP to true

Example

This is an example of a simple NPM build workflow that will clean the working directory after each execution.

name: My Workflow

on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  build:
    runs-on: self-hosted

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v3
      - run: npm ci
      - run: npm run build
      - uses: eviden-actions/clean-self-hosted-runner@v1
        if: ${{ always() }} # Run even if previous steps in the job fail or are canceled

Clean self-hosted runner is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Clean working directory on self-hosted runners
v1.3.26
Latest

Verified

GitHub has manually verified the creator of the action as an official partner organization. For more info see About badges in GitHub Marketplace.

Tags

 (1)

Clean self-hosted runner is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.