Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conditionally remove google-cloud-sdk #1

Merged
merged 5 commits into from
Sep 27, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
steps:
# If there is a problem with this GitHub Actions, this step will fail
- name: Free Disk Space
uses: hirnidrin/free-disk-space@main
uses: descriptinc/free-disk-space@main
with:
tool-cache: true

Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ A customizable GitHub Actions to free disk space on Linux GitHub Actions runners

On a typical Ubuntu runner, with all options turned on (or not turned off rather), this can clear up to 31 GB of disk space in about 3 minutes (the longest period is calling `apt` to uninstall packages). This is useful when you need a lot of disk space to run computations.

Please don't hesitate to [submit issues](https://github.com/jlumbroso/free-disk-space/issues) to report problems or suggest new features (or sets of files to help remove).

Also, please ⭐️ the repo if you like this GitHub Actions! Thanks! 😊

## Example

```yaml
Expand All @@ -20,7 +16,7 @@ jobs:
steps:

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
uses: descriptinc/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
Expand Down
5 changes: 3 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,14 @@ runs:
if [[ ${{ inputs.large-packages }} == 'true' ]]; then
BEFORE=$(getAvailableSpace)

sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^aspnetcore-.*'
sudo apt-get remove -y '^dotnet-.*'
sudo apt-get remove -y '^llvm-.*'
sudo apt-get remove -y 'php.*'
sudo apt-get remove -y '^mongodb-.*'
sudo apt-get remove -y '^mysql-.*'
sudo apt-get remove -y azure-cli google-cloud-sdk google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri
sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri

Choose a reason for hiding this comment

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

can we do a conditional remove? it seems that the errors are raised because some github runners don't have cloud sdk installed

Choose a reason for hiding this comment

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

But it will be useful to remove if it's installed.

sudo apt-get remove -y google-cloud-sdk || sudo apt-get remove -y google-cloud-cli || true
sudo apt-get autoremove -y
sudo apt-get clean

Expand Down