Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7b6ea99

Browse files
committed
Expose --source and --origin as environment variables
1 parent 7525652 commit 7b6ea99

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pre_commit/commands/run.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ def run(runner, args, environ=os.environ):
220220
)
221221
return 1
222222

223+
# Expose origin / source as environment variables for hooks to consume
224+
if args.origin and args.source:
225+
environ['PRE_COMMIT_ORIGIN'] = args.origin
226+
environ['PRE_COMMIT_SOURCE'] = args.source
227+
223228
if no_stash:
224229
ctx = noop_context()
225230
else:

0 commit comments

Comments
 (0)