Skip to content

Commit

Permalink
feat: use org runners instead
Browse files Browse the repository at this point in the history
  • Loading branch information
avx-rodmans committed Dec 7, 2023
1 parent 7fcf198 commit 8fb8d19
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module "aws_ecs_github_runner" {
runners = {
runner_1 = {
org = "My_Org"
repository = "repo"
labels = "aws,ecs,private"
}
runner_2 = {
Expand Down
5 changes: 2 additions & 3 deletions docker-src/scripts/start.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

GH_OWNER=$GH_OWNER
GH_REPOSITORY=$GH_REPOSITORY
GH_TOKEN=$GH_TOKEN
LABELS=$LABELS

Expand All @@ -10,11 +9,11 @@ RUNNER_NAME="${RUNNER_PREFIX}-${RUNNER_SUFFIX}"

echo "Configuring runner ${RUNNER_NAME}..."

REG_TOKEN=$(curl -sX POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${GH_TOKEN}" https://api.github.com/repos/${GH_OWNER}/${GH_REPOSITORY}/actions/runners/registration-token | jq .token --raw-output)
REG_TOKEN=$(curl -sX POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${GH_TOKEN}" https://api.github.com/orgs/${GH_OWNER}/actions/runners/registration-token | jq .token --raw-output)

cd /home/docker/actions-runner

./config.sh --unattended --url https://github.com/${GH_OWNER}/${GH_REPOSITORY} \
./config.sh --unattended --url https://github.com/${GH_OWNER} \
--token ${REG_TOKEN} \
--name ${RUNNER_NAME} \
--labels "${LABELS:-default}" \
Expand Down
4 changes: 0 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ resource "aws_ecs_task_definition" "runner" {
"name" : "GH_OWNER",
"value" : "${each.value.org}"
},
{
"name" : "GH_REPOSITORY",
"value" : "${each.value.repository}"
},
{
"name" : "LABELS",
"value" : "${each.value.labels}"
Expand Down
1 change: 0 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ variable "secret_arn_override" {
variable "runners" {
type = map(object({
org = string
repository = optional(string)
labels = optional(string)
runner_prefix = optional(string)
}))
Expand Down

0 comments on commit 8fb8d19

Please sign in to comment.