3
votes

How do I build a Public GitHub repository using Azure DevOps as part of my Build Pipeline? For example, I use an Open Source toolkit such as SonarQube I'd like the SonarQube deployed using Continuous Integration - ideally - so my development team always has the latest server.

Looks like I have to fork the repository and provide the repo access to Azure Pipeline. Azure DevOps only lists my own repositories - hence the fork - and since I have admin access to them - I'm able to provide access to Azure Pipeline.

Is there a way to do this with only a "read" access?

1
Are you using YAML builds or visual designer builds?Daniel Mann
@DanielMann: It's a YAML GitHub (YAML) pipeline. It doesn't seem to matter as you need a Service Connection to GitHub before you can even create a pipeline. The Service connection (either Installation Token or PAT both) can only be to YOUR own repositories.Vyas Bharghava
For this specific example, I figured I only needed a git clone. On a hunch I tried using "Other Git Repo", typed in the public clone URL and my github username and password (which only had read access to the public repo). Then copied the files to drop folder and published the same. This would help if the server needed to be installed from the Release pipeline. However, SonarQube typically would only be used during build. So, it would be simpler to directly execute 'git clone <public repo url>' using the Command Line task in the build pipeline & install the server before analyzing the codeVyas Bharghava
If the GitHub Repository is public, the option Other Git Repo should work for you, how about this issue now?Leo Liu-MSFT
I tried to do this using the Other Git/YAML option to build a public repo (MarcStan/lets-encrypt-azure) with the azure-pipelines.yml file present in the repo root. Saving the pipeline resulted in this error: "Unable to configure a service on the selected GitHub repository. This is likely caused by not having the necessary permission to manage hooks for the selected repository." So no, @leo-liu-msft that option does not seem to work with read-only access.Bob Meyers

1 Answers

1
votes

You can create public project in Azure DevOps or use GitHub integration https://github.com/marketplace/azure-pipelines to use azure-pipelines with is the best option for you case. Or directly in azure pipelines definition select GitHub or external git repository.