Skip to content

Commit

Permalink
fix: recreate GITHUB_WORKSPACE if it was a subfolder of mount path
Browse files Browse the repository at this point in the history
  • Loading branch information
easimon committed Nov 27, 2023
1 parent 4126645 commit ea7e540
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ runs:
BUILD_MOUNT_PATH="${GITHUB_WORKSPACE}"
fi
# ensure mount path exists
mdkir -p "${BUILD_MOUNT_PATH}"
find "${BUILD_MOUNT_PATH}" -maxdepth 0 ! -empty -exec echo 'WARNING: directory [{}] is not empty, data loss might occur.' \;
echo "Arguments:"
echo
echo " Root reserve: ${{ inputs.root-reserve-mb }} MiB"
Expand Down Expand Up @@ -111,6 +107,10 @@ runs:
fi
echo
# ensure mount path exists
mkdir -p "${BUILD_MOUNT_PATH}"
find "${BUILD_MOUNT_PATH}" -maxdepth 0 ! -empty -exec echo 'WARNING: directory [{}] is not empty, data loss might occur.' \;
echo "Removing unwanted software... "
if [[ ${{ inputs.remove-dotnet }} == 'true' ]]; then
sudo rm -rf /usr/share/dotnet
Expand Down Expand Up @@ -179,6 +179,9 @@ runs:
sudo chown -R runner "${BUILD_MOUNT_PATH}"
sudo chgrp -R runner "${BUILD_MOUNT_PATH}"
# if build mount path is a parent of $GITHUB_WORKSPACE, recreate it
sudo mkdir -p "${GITHUB_WORKSPACE}"
- name: Disk space report after modification
shell: bash
run: |
Expand Down

0 comments on commit ea7e540

Please sign in to comment.