Skip to content

Commit

Permalink
Update action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaGarg8 authored Apr 12, 2024
1 parent 992b394 commit 691c136
Showing 1 changed file with 47 additions and 4 deletions.
51 changes: 47 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,35 @@ branding:
color: 'blue'
inputs:
remove-dotnet:
description: 'Removes .NET runtime and libraries. (frees ~4 GB)'
description: 'Removes .NET runtime and libraries. (frees ~2 GB)'
required: false
default: 'false'
remove-android:
description: 'Removes Android SDKs and Tools. (frees ~11 GB)'
description: 'Removes Android SDKs and Tools. (frees ~9 GB)'
required: false
default: 'false'
remove-haskell:
description: 'Removes GHC (Haskell) artifacts. (frees a few MBs)'
description: 'Removes GHC (Haskell) artifacts. (frees ~5.2 GB)'
required: false
default: 'false'
remove-codeql:
description: 'Removes CodeQL Action Bundles. (frees ~5.4 GB)'
required: false
default: 'false'
remove-docker-images:
description: 'Removes cached Docker images. (frees ~3 GB)'
description: 'Removes cached Docker images. (frees ~3.2 GB)'
required: false
default: 'false'
remove-large-packages:
description: 'Removes unwanted large Apt packages. (frees ~3.1 GB)'
required: false
default: 'false'
remove-cached-tools:
description: 'Removes cached tools used by GitHub's setup actions. (frees ~8.3 GB)'
required: false
default: 'false'
remove-swap:
description: 'Removes the Swapfile. (frees ~4 GB)'
required: false
default: 'false'
runs:
Expand Down Expand Up @@ -55,6 +67,15 @@ runs:
if [[ ${{ inputs.remove-docker-images }} == 'true' ]]; then
echo -n "docker "
fi
if [[ ${{ inputs.remove-large-packages }} == 'true' ]]; then
echo -n "docker "
fi
if [[ ${{ inputs.remove-cached-tools }} == 'true' ]]; then
echo -n "docker "
fi
if [[ ${{ inputs.remove-swap }} == 'true' ]]; then
echo -n "docker "
fi
echo
echo "Removing unwanted software... "
Expand All @@ -66,13 +87,35 @@ runs:
fi
if [[ ${{ inputs.remove-haskell }} == 'true' ]]; then
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/.ghcup
fi
if [[ ${{ inputs.remove-codeql }} == 'true' ]]; then
sudo rm -rf /opt/hostedtoolcache/CodeQL
fi
if [[ ${{ inputs.remove-docker-images }} == 'true' ]]; then
sudo docker image prune --all --force > /dev/null
fi
if [[ ${{ inputs.remove-large-packages }} == 'true' ]]; then
sudo apt-get remove -y '^aspnetcore-.*' > /dev/null
sudo apt-get remove -y '^dotnet-.*' > /dev/null
sudo apt-get remove -y '^llvm-.*' > /dev/null
sudo apt-get remove -y 'php.*' > /dev/null
sudo apt-get remove -y '^mongodb-.*' > /dev/null
sudo apt-get remove -y '^mysql-.*' > /dev/null
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing > /dev/null
sudo apt-get remove -y google-cloud-sdk --fix-missing > /dev/null
sudo apt-get remove -y google-cloud-cli --fix-missing > /dev/null
sudo apt-get autoremove -y > /dev/null
sudo apt-get clean > /dev/null
fi
if [[ ${{ inputs.remove-cached-tools }} == 'true' ]]; then
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
fi
if [[ ${{ inputs.remove-swap }} == 'true' ]]; then
sudo swapoff -a
sudo rm -f /mnt/swapfile
free -h
fi
echo "... done"
- name: Disk space report after modification
Expand Down

0 comments on commit 691c136

Please sign in to comment.