Skip to content

Commit

Permalink
Merge pull request #3580 from twz123/backport-3575-to-release-1.27
Browse files Browse the repository at this point in the history
[Backport release-1.27] Reclaim GitHub Runner disk space
  • Loading branch information
twz123 authored Oct 12, 2023
2 parents 2b80b83 + be6211f commit 621e6c0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Reclaim runner disk space
run: .github/workflows/reclaim-runner-disk-space.bash

- name: Prepare build environment
run: .github/workflows/prepare-build-env.sh

Expand Down Expand Up @@ -348,6 +351,9 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Reclaim runner disk space
run: .github/workflows/reclaim-runner-disk-space.bash

- name: Prepare build environment
run: .github/workflows/prepare-build-env.sh

Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/reclaim-runner-disk-space.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set +eux

if [ -z "$GITHUB_RUN_ID" ]; then
echo "Cowardly refusing to destroy a machine that doesn't look like a GitHub runner." >&2
exit 0
fi

df -h /

docker system prune --all --force &
sudo rm -rf /imagegeneration/installers &
sudo rm -rf -- "${ANDROID_SDK_ROOT-/opt/nevermind}" &

wait

df -h /

0 comments on commit 621e6c0

Please sign in to comment.