mirror of
https://github.com/ansible/ansible-documentation.git
synced 2026-03-27 13:28:51 +07:00
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
15 lines
324 B
Bash
Executable File
15 lines
324 B
Bash
Executable File
#!/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"
|