Skip to content

Commit

Permalink
configure s3 to dualstack if ipv6 is used
Browse files Browse the repository at this point in the history
  • Loading branch information
imishchuk-carbon committed Oct 20, 2023
1 parent 00e7851 commit 85865ad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions modules/runners/templates/install-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ if [ -z "$RUNNER_TARBALL_URL" ] && [ -z "$s3_location" ]; then
exit 1
fi

ipv6=$(TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600"` \
&& curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/ipv6 2>/dev/null | head -n 1 | cut -d$' ' -f2)

if [[ $ipv6 == '200' ]]; then
aws configure set default.s3.use_dualstack_endpoint true
aws configure set default.s3.addressing_style virtual
fi

file_name="actions-runner.tar.gz"

echo "Setting up GH Actions runner tool cache"
Expand Down

0 comments on commit 85865ad

Please sign in to comment.