Skip to content
This repository was archived by the owner on Jan 16, 2025. It is now read-only.

Commit 775a548

Browse files
feat(runner): include instance type & availability zone in Github Action logs (#3223)
feat(runners): Include instance type & availability zone in logs Co-authored-by: Niek Palm <[email protected]>
1 parent bf4cea8 commit 775a548

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: modules/runners/templates/start-runner.sh

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ echo "Retrieved REGION from AWS API ($region)"
1313
instance_id=$(curl -f -H "X-aws-ec2-metadata-token: $token" -v http://169.254.169.254/latest/meta-data/instance-id)
1414
echo "Retrieved INSTANCE_ID from AWS API ($instance_id)"
1515

16+
instance_type=$(curl -f -H "X-aws-ec2-metadata-token: $token" -v http://169.254.169.254/latest/meta-data/instance-type)
17+
availability_zone=$(curl -f -H "X-aws-ec2-metadata-token: $token" -v http://169.254.169.254/latest/meta-data/placement/availability-zone)
18+
1619
%{ if metadata_tags == "enabled" }
1720
environment=$(curl -f -H "X-aws-ec2-metadata-token: $token" -v http://169.254.169.254/latest/meta-data/tags/instance/ghr:environment)
1821
ssm_config_path=$(curl -f -H "X-aws-ec2-metadata-token: $token" -v http://169.254.169.254/latest/meta-data/tags/instance/ghr:ssm_config_path)
@@ -92,6 +95,10 @@ tee /opt/actions-runner/.setup_info <<EOL
9295
{
9396
"group": "Runner Image",
9497
"detail": "AMI id: $ami_id"
98+
},
99+
{
100+
"group": "EC2",
101+
"detail": "Instance type: $instance_type\nAvailability zone: $availability_zone"
95102
}
96103
]
97104
EOL

0 commit comments

Comments
 (0)