Skip to content

Commit 420f1aa

Browse files
authored
[CI] Remove a few predefined runner files before releasing npm packages (#2775)
## Motivation for the change, related issues Updates the publish-npm-packages.yml job to prevent the CI runner from running out of disk space. https://github.com/WordPress/wordpress-playground/actions/runs/18473424159/job/52632469981 ``` lerna ERR! lerna ERR! lerna ENOSPC: no space left on device, write ``` ## Implementation details Removes a bunch of large files that seem to be present at the start of the job: ``` - name: Free up runner disk space shell: bash run: | set -euo pipefail echo "Disk usage before cleanup:" df -h sudo rm -rf /usr/local/lib/android sudo rm -rf /usr/share/dotnet sudo rm -rf "$AGENT_TOOLSDIRECTORY" sudo rm -rf /opt/ghc sudo rm -rf /opt/hostedtoolcache/CodeQL echo "Disk usage after cleanup:" df -h ``` ## Testing Instructions (or ideally a Blueprint) GitHub and testing CI PRs? Haha. Nope. Merge, run the job, hope for the best.
1 parent b750c39 commit 420f1aa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/publish-npm-packages.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ jobs:
3737
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
3838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3939
steps:
40+
- name: Free up runner disk space
41+
shell: bash
42+
run: |
43+
set -euo pipefail
44+
echo "Disk usage before cleanup:"
45+
df -h
46+
sudo rm -rf /usr/local/lib/android
47+
sudo rm -rf /usr/share/dotnet
48+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
49+
sudo rm -rf /opt/ghc
50+
sudo rm -rf /opt/hostedtoolcache/CodeQL
51+
echo "Disk usage after cleanup:"
52+
df -h
4053
- uses: actions/checkout@v4
4154
with:
4255
ref: ${{ github.event.pull_request.head.ref }}

0 commit comments

Comments
 (0)