summary refs log tree commit diff
path: root/maintainers/scripts
diff options
context:
space:
mode:
authorJosé Luis Lafuente <jl@lafuente.me>2021-09-03 11:48:07 +0200
committerMatthieu Coudron <teto@users.noreply.github.com>2021-09-03 12:35:12 +0200
commitb891957a976e4118322b36ab9e312e79925ec5d8 (patch)
tree386c5ad7852b0c29ac3d31f131294f5ae9ee5db9 /maintainers/scripts
parent130496a800d577e2bf08af33e3c0a263b41272f3 (diff)
downloadnixpkgs-b891957a976e4118322b36ab9e312e79925ec5d8.tar
nixpkgs-b891957a976e4118322b36ab9e312e79925ec5d8.tar.gz
nixpkgs-b891957a976e4118322b36ab9e312e79925ec5d8.tar.bz2
nixpkgs-b891957a976e4118322b36ab9e312e79925ec5d8.tar.lz
nixpkgs-b891957a976e4118322b36ab9e312e79925ec5d8.tar.xz
nixpkgs-b891957a976e4118322b36ab9e312e79925ec5d8.tar.zst
nixpkgs-b891957a976e4118322b36ab9e312e79925ec5d8.zip
Allow to execute update script in CI environment
If the script is executed in a CI (like in github actions, with the
install-nix-action) it fails. This changes fixes that use case. In that
scenario, you should provide the --no-commit flag.
Diffstat (limited to 'maintainers/scripts')
-rw-r--r--maintainers/scripts/pluginupdate.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/maintainers/scripts/pluginupdate.py b/maintainers/scripts/pluginupdate.py
index c468b33bb47..2a9a2d4c0a2 100644
--- a/maintainers/scripts/pluginupdate.py
+++ b/maintainers/scripts/pluginupdate.py
@@ -547,7 +547,6 @@ def update_plugins(editor: Editor, args):
 
     log.setLevel(LOG_LEVELS[args.debug])
     log.info("Start updating plugins")
-    nixpkgs_repo = git.Repo(editor.root, search_parent_directories=True)
     update = editor.get_update(args.input_file, args.outfile, args.proc)
 
     redirects = update()
@@ -556,6 +555,7 @@ def update_plugins(editor: Editor, args):
     autocommit = not args.no_commit
 
     if autocommit:
+        nixpkgs_repo = git.Repo(editor.root, search_parent_directories=True)
         commit(nixpkgs_repo, f"{editor.attr_path}: update", [args.outfile])
 
     if redirects: