From fc4c02a019aa793fb6a0f575147e26f2661ef900 Mon Sep 17 00:00:00 2001 From: James Pace Date: Tue, 14 Feb 2023 23:14:35 -0500 Subject: [PATCH] Change default branch. --- README.md | 4 ++-- j7s_branch_trigger/j7s_branch_trigger.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b6ad7c..36ac23e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ which are checked at start up. * `J7S_URL` - **Required** the url to post to if a change is seen. * `J7S_HISTORY_FILE` - Default: '/tmp/branch-history.json' the location to save the last seen state. -* `J7S_PATTERN` - Default: '(^HEAD$|refs/heads/(master|main)$)' python - flavored regex to find branches of concern +* `J7S_PATTERN` - Default: '^HEAD$' python flavored regex to find + branches of concern, for specific branch use '^refs/heads/branch$' * `J7S_LOOPTIME` - Default: 1.0 minutes between checks of the state of of the repo diff --git a/j7s_branch_trigger/j7s_branch_trigger.py b/j7s_branch_trigger/j7s_branch_trigger.py index 0371cde..ca56786 100644 --- a/j7s_branch_trigger/j7s_branch_trigger.py +++ b/j7s_branch_trigger/j7s_branch_trigger.py @@ -96,7 +96,7 @@ def get_config(): if not url or not repo: raise Exception('Missing J7S_REPO OR J7S_URL.') data_file = os.environ.get('J7S_HISTORY_FILE', '/tmp/branch-history.json') - pattern = os.environ.get('J7S_PATTERN', '(^HEAD$|refs/heads/(master|main)$)') + pattern = os.environ.get('J7S_PATTERN', '^HEAD$') loop_time = float(os.environ.get('J7S_LOOPTIME', 1.0)) return (repo, url, data_file, pattern, loop_time)