Skip to content

Commit

Permalink
fixup! Add GitHub support to check_branch.py script
Browse files Browse the repository at this point in the history
  • Loading branch information
achave11-ucsc committed Jan 15, 2025
1 parent bda8d39 commit f83c00e
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions scripts/check_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Sequence,
)

import attrs
import git

from azul import (
Expand Down Expand Up @@ -40,11 +41,11 @@ def __init__(self,
f'only {allowed}personal deployments.')


@dataclass(kw_only=True)
@attrs.frozen(auto_attribs=True, kw_only=True)
class BranchContext:
name: Optional[str]
base_ref: Optional[str]
head_ref: Optional[str]
name: str | None
base_ref: str | None
head_ref: str | None
platform: str


Expand Down Expand Up @@ -115,17 +116,6 @@ def main(argv):
print(deployment)
else:
check_branch(branch, config.deployment_stage)
allowed_deployments = config.shared_deployments_for_branch(branch)
if deployment == 'prod':
if branch != 'prod' and branch_in_context.base_ref != 'prod':
raise BranchDeploymentMismatch(branch,
config.Deployment(deployment),
allowed_deployments)
elif deployment == 'dev':
if branch != 'develop' and branch_in_context.base_ref != 'develop':
raise BranchDeploymentMismatch(branch,
config.Deployment(deployment),
allowed_deployments)


if __name__ == '__main__':
Expand Down

0 comments on commit f83c00e

Please sign in to comment.