mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Merge pull request #550 from pre-commit/origin_source_environment_variables
Expose --source and --origin as environment variables
This commit is contained in:
commit
84436ad884
1 changed files with 5 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue