Files
ansible-docs/hacking/get_bot_user.sh
Maxwell G 1efa06b8a6 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
2023-10-17 14:35:41 -05:00

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"