terraform-google-modules/terraform-google-github-actions-runners

Include example for Github Org

jwcmd opened this issue · 5 comments

jwcmd commented

There's a ton of examples already documented and I can't tell you how much I appreciate what's already there, thank you!

That said, I'm looking to connect a self-hosted runner to an entire Github Org, it would be cool if we could use this against an Org.

If I'm able to find an incantation that works I'll gladly submit a PR :D

Hi @jwcmd
Looks like we need a small modification to support this.
Currently we get the registration token here

ACTIONS_RUNNER_INPUT_TOKEN="$(curl -sS --request POST --url "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/actions/runners/registration-token" --header "authorization: Bearer ${GITHUB_TOKEN}" --header 'content-type: application/json' | jq -r .token)"

This should be switched based on if org or repo, org endpoint is documented here. Within the TF code we can store the type of runner (org/repo) in the metadata and access that during runtime.

helpful module. I also need to add github runner to an org. I think adding to org is by far the most common use case for github runner so updating modules to support org along with adding an example will be great.

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

+1, I would also like to use this module for org runners.

Org runners (#34) and examples (#37) have been added.