Skip to content

Added github url to config.cmd #1

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

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions modules/runners/runner-config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ resource "aws_ssm_parameter" "runner_agent_mode" {
tags = local.tags
}

resource "aws_ssm_parameter" "gh_url" {
name = "${var.ssm_paths.root}/${var.ssm_paths.config}/gh_url"
type = "String"
value = var.enable_ephemeral_runners ? "ephemeral" : "persistent"
tags = local.tags
}

resource "aws_ssm_parameter" "jit_config_enabled" {
name = "${var.ssm_paths.root}/${var.ssm_paths.config}/enable_jit_config"
type = "String"
Expand Down
5 changes: 4 additions & 1 deletion modules/runners/templates/start-runner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Write-Host "Retrieved $ssm_config_path/agent_mode parameter - ($agent_mode)"
$token_path=$parameters.where( {$_.Name -eq "$ssm_config_path/token_path"}).value
Write-Host "Retrieved $ssm_config_path/token_path parameter - ($token_path)"

$gh_url=$parameters.where( {$_.Name -eq "$ssm_config_path/gh_url"}).value
Write-Host "Retrieved $ssm_config_path/gh_url parameter - ($gh_url)"


if ($enable_cloudwatch_agent -eq "true")
{
Expand Down Expand Up @@ -107,7 +110,7 @@ foreach ($group in @("Administrators", "docker-users")) {
Set-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -Value 0 -Force
Write-Host "Disabled User Access Control (UAC)"

$configCmd = ".\config.cmd --unattended --name $runner_name_prefix$InstanceId --work `"_work`" $config"
$configCmd = ".\config.cmd --unattended --url $gh_url --name $runner_name_prefix$InstanceId --work `"_work`" $config"
Write-Host "Configure GH Runner as user $run_as"
Invoke-Expression $configCmd

Expand Down
6 changes: 6 additions & 0 deletions modules/runners/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ variable "runner_log_files" {
default = null
}

variable "gh_url" {
description = "GitHub URL with Org ID included."
type = string
default = null
}

variable "ghes_url" {
description = "GitHub Enterprise Server URL. DO NOT SET IF USING PUBLIC GITHUB"
type = string
Expand Down