Skip to main content

Repository: upgrade-ruby-version

A script to upgrade the version of Ruby used by a project.

Ownership
#govuk-platform-reliability-team
Hosting
N/A
Category
Utilities

README

A script to upgrade the version of Ruby used by a project.

Prerequisites

  • pipenv (brew install pipenv)
  • jq (brew install jq)

Setup

Create a .env file with the following contents:

GITHUB_ACCESS_TOKEN=personal_access_token

You’ll need to create a personal access token with a repo scope so that you have write access to GOV.UK repositories.

It’s advised not to use your personal GitHub account to create the access token, as another developer will need to approve the PRs. You can use govuk-ci GitHub account.

Install dependencies:

pipenv install

Configure the script

Configure which Ruby versions should be upgraded.

When upgrading a specific list of repos (e.g. only those owned by your team), set up the list of repos with hardcoded values:

repos = [
    'alphagov/authenticating-proxy',
    'alphagov/bouncer',
]

Run the script

This will open pull requests in every repository you’ve configured it to:

pipenv run python main.py

You can see the created PRs by visiting https://github.com/pulls.