Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/six-taxis-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"free-disk-space": major
---

feat: initial release
3 changes: 3 additions & 0 deletions actions/free-disk-space/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# free-disk-space

Frees up disk space. See `action.yml` for what it deletes.
41 changes: 41 additions & 0 deletions actions/free-disk-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: free-disk-space
description: "Delete specific directories or files to free disk space"

inputs: {}

runs:
using: composite
steps:
- name: Free Disk Space
shell: bash
run: |
# Define a list of directories or files to delete
TO_DELETE=(
"/usr/share/dotnet"
"/usr/local/lib/android"
"/usr/local/share/powershell"
"/usr/local/share/chromium"
"/usr/local/lib/heroku"
"/usr/local/share/boost"
"/usr/local/share/miniconda"
"/opt/hostedtoolcache/CodeQL"
"/opt/hostedtoolcache/Ruby"
"/usr/lib/jvm"
"/opt/hostedtoolcache/Java_*"
"/opt/microsoft"
"/opt/google"
)

echo "Starting disk cleanup..."

# Loop through and delete each item if it exists
for path in "${TO_DELETE[@]}"; do
if [ -e "$path" ]; then
echo "::info::Deleting: $path"
sudo rm -rf "$path" || true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this ends up being slow or as an optimization, we should consider gnu parallel since it's already installed.

else
echo "::info::Not found (skipping): $path"
fi
done

echo "Disk cleanup complete."
11 changes: 11 additions & 0 deletions actions/free-disk-space/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "free-disk-space",
"version": "0.0.0",
"description": "",
"private": true,
"scripts": {},
"author": "@smartcontractkit",
"license": "MIT",
"dependencies": {},
"repository": "https://github.com/smartcontractkit/.github"
}
7 changes: 7 additions & 0 deletions actions/free-disk-space/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "free-disk-space",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "actions/free-disk-space",
"targets": {}
}
Loading