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

Select alternative apt mirror to get around the unstable original one #7

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ inputs:
required: false
default: "true"

allow-apt-mirrors:
description: "Allow use of alternative apt mirrors"
required: false
default: "false"
apt-mirror-country:
description: "Location of the apt mirror to use (if using GitHub cloud runners, select 'US')"
required: false
default: "US"

runs:
using: "composite"
steps:
Expand Down Expand Up @@ -171,6 +180,13 @@ runs:

if [[ ${{ inputs.large-packages }} == 'true' ]]; then
BEFORE=$(getAvailableSpace)

if [[ ${{ inputs.allow-apt-mirrors }} == 'true' ]]; then
# Select alternative apt mirror
sudo gem install apt-spy2
sudo apt-spy2 fix --commit --launchpad --country=${{ inputs.apt-mirror-country }}
sudo apt-get update
fi

sudo apt-get remove -y '^aspnetcore-.*' || echo "::warning::The command [sudo apt-get remove -y '^aspnetcore-.*'] failed to complete successfully. Proceeding..."
sudo apt-get remove -y '^dotnet-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^dotnet-.*' --fix-missing] failed to complete successfully. Proceeding..."
Expand Down