mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 02:21:46 +04:00
The remote branch reference was exposed as an environment variable for a pre-push hook, which makes decisions on git pushes to a particular remote branch name pattern.
This commit is contained in:
parent
a062cbd439
commit
945549acbc
3 changed files with 13 additions and 1 deletions
|
|
@ -371,6 +371,11 @@ def run(
|
|||
environ['PRE_COMMIT_FROM_REF'] = args.from_ref
|
||||
environ['PRE_COMMIT_TO_REF'] = args.to_ref
|
||||
|
||||
# Exposes remote branch ref as an environment variable
|
||||
# for pre-push hooks consumption
|
||||
if args.remote_branch:
|
||||
environ['PRE_COMMIT_REMOTE_REF'] = args.remote_branch
|
||||
|
||||
if args.remote_name and args.remote_url:
|
||||
environ['PRE_COMMIT_REMOTE_NAME'] = args.remote_name
|
||||
environ['PRE_COMMIT_REMOTE_URL'] = args.remote_url
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue