diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py index aa9bb1e2..a8e61193 100644 --- a/pre_commit/commands/run.py +++ b/pre_commit/commands/run.py @@ -220,6 +220,11 @@ def run(runner, args, environ=os.environ): ) return 1 + # Expose origin / source as environment variables for hooks to consume + if args.origin and args.source: + environ['PRE_COMMIT_ORIGIN'] = args.origin + environ['PRE_COMMIT_SOURCE'] = args.source + if no_stash: ctx = noop_context() else: