3.4 KiB
Migrate an Azure DevOps pipeline to GitHub Actions
In this lab, we will use the Valet migrate command to migrate a GitLab pipeline to GitHub Actions.
All of the previous commands we have been using in the labs, such as audit and dry-run have been preparing us to run a migration.
The migrate command will generate the GitHub Actions workflow files, like the dry-run did, and also create a pull request with the files.
The pull request will also contain a checklist of Manual Tasks if required. These tasks are changes that Valet could not do on our behalf, like creating a runner or adding a secret to a repository.
Prerequisites
- Followed steps to set up your codespace environment.
- Completed the configure lab
Preparing for migration
Before running the command we need to collect some information:
- What is the project we want to migrate? rails-example
- What is the namespace for that project? Valet. In this case the namespace is the same as the group the project is in
- Where do we want to store the logs? ./tmp/migrate.
- What is the URL for GitHub repository we want to add the workflow too? this repo!. When constructing the value for the migrate command it should match this url https://github.com/GITHUB-ORG-USERNAME-HERE/GITHUB-REPO-NAME-HERE with
GITHUB-ORG-USERNAMEandGITHUB-REPO-NAMEsubstitued with your values
Performing a migration
- Run
migratecommand using the information collected above, make sure to update the--target-urlvalue with the information from step 4.
gh valet migrate gitlab --target-url https://github.com/GITHUB-ORG-USERNAME-HERE/GITHUB-REPO-NAME-HERE --output-dir ./tmp/migrate --namespace valet --project rails-example
- Valet will create a pull request directly in the target GitHub repository.
- Open the pull request by clicking the green pull request link in the output of the migrate command, if you have trouble clicking it you can always copy and paste the url in your browser.

Reviewing the pull request
-
Lets first look at the
Conversationtab of the PR. It tells us we have a manual task to perform before the GitHub Actions workflow is functional. We need to a secret. We can use the GitHub documentation for secrets and add aactionssecret forPASSWORDwith any value. -
Next, lets review the workflow we are adding by clicking on
Files changedtab. This is where you would double check everything looks good. -
Now our review is completed we want to go back to the
Conversationtab and clickMerge pull request -
Once the PR is merged the new workflow should start and we can view it by clicking
Actionsin the top navigation