Skip to content

Add a ref parameter to the pipeline updater script

Etienne Baqué requested to merge eb-fix-default-branch into master

What does this MR do?

This MR adds a ref parameter to the script/pipeline_ref_updater.rb.

Running the updater script in the CustomersDot project has been failing (see this job, for example), since the project changed its default branch from master to main. As a result, we need the script/pipeline_ref_updater.rb to have the flexibility to run against a specified ref.

Manual test

Running the following locally:

REF_UPDATE_GITLAB_API_TOKEN=<your_token> ruby script/pipeline_ref_updater.rb "gitlab-org/customers-gitlab-com" .gitlab-ci.yml

will trigger the error as seen in the failing job linked above. When adding main:

REF_UPDATE_GITLAB_API_TOKEN=<your_token> ruby script/pipeline_ref_updater.rb "gitlab-org/customers-gitlab-com" .gitlab-ci.yml main

another error message will show up, but it looks like it's related to the fact that we're running this script outside of a CI context.

Check-list

Merge request reports