nixos/services.github-runners: handle github oauth access tokens

This commit is contained in:
Joshua Peek
2026-01-06 10:39:26 -08:00
parent c85ee87afe
commit be1811edb1
@@ -187,7 +187,7 @@
# If the token file contains a PAT (i.e., it starts with "ghp_" or "github_pat_"), we have to use the --pat option,
# if it is not a PAT, we assume it contains a registration token and use the --token option
token=$(<"${newConfigTokenPath}")
if [[ "$token" =~ ^ghp_* ]] || [[ "$token" =~ ^github_pat_* ]]; then
if [[ "$token" =~ ^gh[a-z]+_* ]] || [[ "$token" =~ ^github_pat_* ]]; then
args+=(--pat "$token")
else
args+=(--token "$token")