Useful scripts

In the Modernisation Platform repository, we have some useful scripts to:

  • help to automate parts of our day-to-day tasks whilst working on the Modernisation Platform
  • map common functions to work in CI/CD

Git scripts

The scripts prefixed git- are for running common git commands as part of CI/CD.

Filename Description Used in CI/CD?
git-setup.sh Configures git with the modernisation-platform-ci GitHub user example
update-pr-comments.sh Add a comment to a pull request example
generate-dependatbot-file.sh Keeps dependabot.yml up to date with module dependencies example

Terraform scripts

The scripts prefixed terraform- are for running common terraform commands as part of CI/CD.

General use

Filename Description Used in CI/CD?
terraform-init.sh Runs terraform init in the provided path with appropriate flags set for CI/CD example
terraform-plan.sh Runs terraform plan in the provided path with appropriate flags set for CI/CD, and redacts the output (see redact-output.sh) example
terraform-apply.sh Runs terraform apply in the provided path with appropriate flags set for CI/CD, and redacts the output (see redact-output.sh) example

Specific use

Filename Description Used in CI/CD?
redact-output.sh Runs sed to redact values from terraform plan and terraform apply example

Other Scripts

Environment Provisioning

Filename Description Used in CI/CD?
provision-terraform-workspaces.sh Runs terraform workspace new ${application-name}-${environment} in the provided directory example
loop-through-terraform-workspaces.sh Runs terraform plan or apply across all remote terraform workspaces in the provided directory example
provision-environment-directories.sh Copies templates/*.tf files to an environment directory when a new environment is created example
provision-member-directories.sh Copies templates/*.tf files to the member environment repository when a new environment is created example
member-account-ram-association.sh Creates networking RAM associations when new networking is created example

Internal scripts

Filename Description Used in CI/CD?
internal/upgrade-terraform-providers.sh This script looks for any directory that holds a *.tf file, unless it's a .terraform directory or is the templates/ directory, and runs terraform init -upgrade within them. It's useful for bulk-updating all of the Terraform providers and modules in one go
internal/find-terraform-workspace.sh This script finds terraform workspaces for an environment when it needs to be deleted
internal/git-commit.sh Checks out a branch named date-${epoch-time} and commits files changed in the provided path
internal/git-pull-request.sh Creates a pull request back to main from the current checked out branch
Last reviewed: 26 February 2026Review status: ✓ Up to dateOwner: #modernisation-platformSource: View source on GitHub

Was this page useful?