Skip to content

Commit 9a03049

Browse files
committed
ci: rename dev branch to main
1 parent 28f6b63 commit 9a03049

File tree

10 files changed

+25
-24
lines changed

10 files changed

+25
-24
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- "**.js"
88
- "**.py"
99
pull_request:
10-
branches: [dev, test, prod]
10+
branches: [main, test, prod]
1111
paths:
1212
- "**.js"
1313
- "**.py"

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- dev
7+
- main
88
- test
99
- prod
1010

.github/workflows/labeler-deploy-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Label dev deploys
22

33
on:
44
pull_request:
5-
branches: [dev]
5+
branches: [main]
66
types: [opened]
77
paths:
88
- ".github/workflows/deploy-*.yml"

.github/workflows/labeler-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Label docs
22

33
on:
44
pull_request:
5-
branches: [dev]
5+
branches: [main]
66
types: [opened]
77
paths:
88
- 'docs/**'

.github/workflows/labeler-infrastructure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Label infrastructure
22

33
on:
44
pull_request:
5-
branches: [dev]
5+
branches: [main]
66
types: [opened]
77
paths:
88
- 'docs/deployment/**'

.github/workflows/mkdocs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ on:
77
types:
88
- completed
99
branches:
10-
- dev
10+
- main
1111
pull_request:
1212
branches:
13-
- dev
13+
- main
1414
paths:
1515
- "docs/**"
1616
- "mkdocs.yml"
1717
- ".github/workflows/mkdocs.yml"
1818
push:
1919
branches:
20-
- dev
20+
- main
2121
paths:
2222
- "docs/**"
2323
- "mkdocs.yml"
@@ -95,7 +95,7 @@ jobs:
9595
uses: dawidd6/action-download-artifact@v6
9696
with:
9797
workflow: tests-pytest.yml
98-
branch: dev
98+
branch: main
9999
event: push
100100
name: coverage-report
101101
path: docs/tests/coverage

.github/workflows/tests-ui.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: UI & a11y tests
33
on:
44
workflow_dispatch:
55
pull_request:
6-
branches: [dev, test, prod]
6+
branches: [main, test, prod]
77

88
defaults:
99
run:

terraform/azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ trigger:
33
# https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#pr-triggers
44
branches:
55
include:
6-
- dev
6+
- main
77
- test
88
- prod
99
# only run for changes to Terraform files

terraform/pipeline/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ steps:
4848
# service connection
4949
environmentServiceNameAzureRM: "${{ parameters.service_connection }}"
5050
# the plan is done as part of the apply (below), so don't bother doing it twice
51-
condition: notIn(variables['Build.SourceBranchName'], 'dev', 'test', 'prod')
51+
condition: notIn(variables['Build.SourceBranchName'], 'main', 'test', 'prod')
5252
- task: TerraformTaskV3@3
5353
displayName: Terraform apply
5454
inputs:
@@ -60,4 +60,4 @@ steps:
6060
# service connection
6161
environmentServiceNameAzureRM: "${{ parameters.service_connection }}"
6262
# only run on certain branches
63-
condition: in(variables['Build.SourceBranchName'], 'dev', 'test', 'prod')
63+
condition: in(variables['Build.SourceBranchName'], 'main', 'test', 'prod')

terraform/pipeline/workspace.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,30 @@
55
import sys
66

77
REASON = os.environ["REASON"]
8+
89
# the name of the variable that Azure Pipelines uses for the source branch
910
# depends on the type of run, so need to check both
1011
SOURCE = os.environ.get("OTHER_SOURCE") or os.environ["INDIVIDUAL_SOURCE"]
12+
1113
TARGET = os.environ["TARGET"]
1214

13-
# the branches that correspond to environments
14-
ENV_BRANCHES = ["dev", "test", "prod"]
15+
# branch to workspace mapping
16+
WORKSPACES = {"main": "dev", "test": "test", "prod": "default"}
17+
# workspace to service connection mapping
18+
SERVICE_CONNECTIONS = {"dev": "Development", "test": "Development", "default": "Production"}
1519

16-
if REASON == "PullRequest" and TARGET in ENV_BRANCHES:
20+
if REASON == "PullRequest" and TARGET in WORKSPACES:
1721
# it's a pull request against one of the environment branches, so use the
1822
# target branch
19-
environment = TARGET
20-
elif REASON in ["IndividualCI", "Manual"] and SOURCE in ENV_BRANCHES:
23+
workspace = WORKSPACES[TARGET]
24+
elif REASON in ["IndividualCI", "Manual"] and SOURCE in WORKSPACES:
2125
# it's being run on one of the environment branches, so use that
22-
environment = SOURCE
26+
workspace = WORKSPACES[SOURCE]
2327
else:
2428
# default to running against dev
25-
environment = "dev"
26-
27-
# matching logic in ../init.sh
28-
workspace = "default" if environment == "prod" else environment
29+
workspace = "dev"
2930

30-
service_connection = "Production" if environment == "prod" else "Development"
31+
service_connection = SERVICE_CONNECTIONS[workspace]
3132

3233
# just for troubleshooting
3334
if TARGET is not None:

0 commit comments

Comments
 (0)