harcode git author in all commands

This makes it easier to locally test the commands without affecting ~/.gitconfig
This commit is contained in:
Jörg Thalheim 2021-02-06 11:26:07 +01:00
parent 36100bcb75
commit bfbeb67ff1
No known key found for this signature in database
GPG key ID: B3F5D81B0C6967C4
4 changed files with 12 additions and 9 deletions

View file

@ -1,5 +0,0 @@
# only source this file
# ==================================================
git config --global user.name "Nur a bot"
git config --global user.email "joerg.nur-bot@thalheim.io"

View file

@ -5,7 +5,6 @@ set -eu -o pipefail # Exit with nonzero exit code if anything fails
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
source ${DIR}/lib/setup-git.sh
set -x
@ -26,7 +25,7 @@ nix run '(import ./release.nix {})' -c nur index nur-combined > nur-search/data/
cd nur-search
if [[ ! -z "$(git diff --exit-code)" ]]; then
git add ./data/packages.json
git commit -m "automatic update package.json"
git commit --author "Nur a bot <joerg.nur-bot@thalheim.io>" -m "automatic update package.json"
git pull --rebase origin master
git push origin master
nix-shell --run "make clean && make && make publish"

View file

@ -23,7 +23,7 @@ if [[ -z "$(git diff --exit-code)" ]]; then
echo "No changes to the output on this push; exiting."
else
git add --all repos.json*
git commit -m "automatic update"
git commit --author "Nur a bot <joerg.nur-bot@thalheim.io>" -m "automatic update"
# in case we are getting overtaken by a different job
git pull --rebase origin master
git push "https://$API_TOKEN_GITHUB@github.com/nix-community/NUR" HEAD:master

View file

@ -42,7 +42,16 @@ def commit_files(files: List[str], message: str) -> None:
cmd.extend(files)
subprocess.check_call(cmd)
if repo_changed():
subprocess.check_call(["git", "commit", "-m", message])
subprocess.check_call(
[
"git",
"commit",
"--author",
"Nur a bot <joerg.nur-bot@thalheim.io>",
"-m",
message,
]
)
def commit_repo(repo: Repo, message: str, path: Path) -> Repo: