mirror of
https://github.com/ansible/ansible-documentation.git
synced 2026-03-26 13:18:58 +07:00
ci: use Github App token to authenticate (#621)
This uses the new Ansible Documentation Bot Github app to authenticate with the Github API instead of the limited token built in to Github Actions. The app token allows creating automatic dependency update PRs that trigger CI properly. A github-bot environment to store the BOT_APP_ID and BOT_APP_KEY secrets. Fixes: https://github.com/ansible/ansible-documentation/issues/382
This commit is contained in:
14
hacking/get_bot_user.sh
Executable file
14
hacking/get_bot_user.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/bash -x
|
||||
|
||||
# Set Github committer to a bot user
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
bot="${1}"
|
||||
name="${2-${1}}"
|
||||
path="https://api.github.com/users/${bot}%5Bbot%5D"
|
||||
user_id="$(curl -sS "${path}" | jq -r .id)"
|
||||
GIT="${GIT:-git}"
|
||||
|
||||
${GIT} config user.name "${name}"
|
||||
${GIT} config user.email "${user_id}+${bot}@users.noreply.github.com"
|
||||
Reference in New Issue
Block a user