-
Notifications
You must be signed in to change notification settings - Fork 26
Managing PATs
You can add more PATs to the secret without having to create a new one.
First, base64 encode the new PAT.
echo -n "$GITHUB_PAT" | base64
Then, patch the new PAT into the existing secret. Give it a different key name than any secret key that is already in use, or you will overwrite the existing value.
Here, our secret is named github-pat
, and we want to name the new PAT new-pat
.
oc patch secret github-pat -p '{ "data": { "new-pat": "<base64 encoded PAT>" } }'
Then, when you re-run step 4, --set secretKey="new-pat"
so the new PAT is used for the new runner.
The procedure above for adding a PAT also works for changing existing PATs to new ones - eg, to replace a revoked PAT with a working one.
Instead of selecting a new secret key name to patch in, just patch the existing secret key that you want to modify. This is determined by the secretKey
value.
Note that existing pods will have to be terminated to be re-created with the new PAT.