Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
command

GitHub Action

Free Disk Space - Ubuntu Runners

v1

Free Disk Space - Ubuntu Runners

command

Free Disk Space - Ubuntu Runners

A Simple Action to Free Up Disk Space on GitHub Hosted Runners

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Free Disk Space - Ubuntu Runners

uses: endersonmenezes/free-disk-space@v1

Learn more about this action in endersonmenezes/free-disk-space

Choose a version

Free Disk Space - Action

GitHub License GitHub Actions Workflow Status GitHub Actions Workflow Status

Inspiration

Free Disk Space Action are inspired by jlumbroso/free-disk-space

Motivation

At work I came across a huge Docker image that still needed to be analyzed by a local security tool. This consumed the entire Runner and in addition to the repository I found, I needed to remove some packages, which led me to create a modification of the original repository.

I will maintain a Stable version of this project.

Use

name: Free Disk Space (Ubuntu)
on:
  - push

jobs:
  free-disk-space:
    runs-on: ubuntu-latest
    steps:
      - name: Free Disk Space
        uses: endersonmenezes/free-disk-space@v1
        with:
          remove_android: true
          remove_dotnet: true
          remove_haskell: true
          remove_tool_cache: true
          remove_swap: true
          remove_packages: "azure-cli google-cloud-cli microsoft-edge-stable google-chrome-stable firefox postgresql* dotnet* temurin-* *llvm* mysql*"
          testing: false

Local Development

The TESTING variable is used to create an alias for the rm command, so that it does not delete the files in the repository. Are more envs to be added, you will see on main.sh file.

export TESTING=true
bash main.sh

Don't forget to export TESTING=true, it make a alias to rm command

Shellcheck

shellcheck main.sh -o all -e SC2033,SC2032

Contributing

If you have any questions, please open an issue.