Merge pull request #324 from Mic92/ci

This commit is contained in:
Jörg Thalheim 2021-02-06 10:34:33 +00:00 committed by GitHub
commit dc81b636a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 12 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

@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -p bash -i bash -p python3Packages.mypy -p python3Packages.black -p python3Packages.flake8
#!nix-shell -p bash -i bash -p python3Packages.mypy -p python3Packages.black -p python3Packages.flake8 -p nix
set -eux -o pipefail # Exit with nonzero exit code if anything fails

View file

@ -1,11 +1,10 @@
#!/usr/bin/env nix-shell
#!nix-shell -p git -p bash -i bash
#!nix-shell -p git -p nix -p bash -i bash
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

@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -p git -p bash -i bash
#!nix-shell -p git -p nix -p bash -i bash
set -eu -o pipefail # Exit with nonzero exit code if anything fails
@ -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: