Skip to content

Commit 1918c08

Browse files
Rename constants and update values
1 parent ab02dc3 commit 1918c08

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

normalize_repos/branch_protections.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
BRANCH_PROTECTION_EXEMPT_REPOSITORIES = [
1+
EXEMPT_REPOSITORIES = [
22
# non-engineering repo
33
"australian-chapter",
44
# non-engineering repo
@@ -27,7 +27,7 @@
2727
"tech-support",
2828
]
2929

30-
BRANCH_PROTECTION_REQUIRED_STATUS_CHECK_MAP = {
30+
REQUIRED_STATUS_CHECK_MAP = {
3131
"cccatalog-api": ["continuous-integration/travis-ci"],
3232
"cccatalog-frontend": ["ci/circleci: lint", "ci/circleci: unit"],
3333
"creativecommons.github.io-source": ["continuous-integration/travis-ci"],
@@ -37,14 +37,14 @@
3737
"netlify/cc-fonts/deploy-preview",
3838
],
3939
"vocabulary": [
40-
"ci/circleci: lint",
41-
"ci/circleci: test",
42-
"ci/circleci: build",
40+
"Lint",
41+
"Unit tests",
42+
"Build",
4343
"netlify/cc-vocabulary/deploy-preview",
4444
],
4545
"vue-vocabulary": [
4646
"ci/circleci: lint",
4747
"ci/circleci: unit",
4848
"netlify/cc-vue-vocabulary/deploy-preview",
4949
],
50-
}
50+
}

normalize_repos/normalize_repos.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
# Local/library specific
1414
from labels import REQUIRED_LABELS
15-
from branch_protections import BRANCH_PROTECTION_EXEMPT_REPOSITORIES, \
16-
BRANCH_PROTECTION_REQUIRED_STATUS_CHECK_MAP
15+
import branch_protections
1716

1817

1918
def set_up_github_client():
@@ -78,13 +77,13 @@ def update_labels(repo):
7877

7978
def update_branch_protection(repo):
8079
master = repo.get_branch("master")
81-
if repo.name not in BRANCH_PROTECTION_EXEMPT_REPOSITORIES:
82-
if repo.name in BRANCH_PROTECTION_REQUIRED_STATUS_CHECK_MAP:
80+
if repo.name not in branch_protections.EXEMPT_REPOSITORIES:
81+
if repo.name in branch_protections.REQUIRED_STATUS_CHECK_MAP:
8382
master.edit_protection(
8483
required_approving_review_count=1,
8584
user_push_restrictions=[],
8685
strict=True,
87-
contexts=BRANCH_PROTECTION_REQUIRED_STATUS_CHECK_MAP[
86+
contexts=branch_protections.REQUIRED_STATUS_CHECK_MAP[
8887
repo.name
8988
],
9089
)

0 commit comments

Comments
 (0)