Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to link Azure DevOps pipeline with GitHub repo #13

Open
eric-labelle opened this issue Feb 7, 2020 · 5 comments
Open

How to link Azure DevOps pipeline with GitHub repo #13

eric-labelle opened this issue Feb 7, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request idle Inactive for 14 days

Comments

@eric-labelle
Copy link

Hi, I'm trying to configure a workflow on a GitHub project using the Azure/pipeline@v1 action and facing a problem. I can successfully trigger the pipeline in Azure DevOps, but it always checkout the master branch from github rather than the PR opened.
I can see the log is trigger from the following: https://github.com/Azure/pipelines/blob/master/src/pipeline.runner.ts#L82
but it is unclear how I can do the link suggested by the comment on line 76

// If definition is linked to existing github repo, pass github source branch and source version to build.

My pipeline on DevOps uses multiple checkout (self and a github repo using a GitHubServiceConnection) and is hosted in a DevOps repository.

Thanks for you help.

@ionutleca
Copy link
Contributor

Looks like definition is linked to existing Github repo means that your az pipeline yaml is in the same Github repository as your action. Since that is not the case, when triggered, the pipeline will just pull whatever the default branch is set up to. (master in this case)

In your case, one option would be to send the commit id from your git workflow to the az pipeline as a run time variable and use it in a checkout step in the pipeline.

#11 has the variables feature you can use.

@eric-labelle
Copy link
Author

Yeah, that was the only logical explanation I came up with but I just don't see the point of the Azure/pipeline@v1 action then.

Quite confusing all that I must say. Too much links in both ways. Or perhaps it's just my usecase that's special. Because the pipeline is defined in a repo in Azure, and this repo has a submodule that's hosted on github and will be open-sourced. I need to be able to trigger the Azure pipeline and make sure the github submodule checkout the sha of the opened PR that triggered this azure pipeline

@ionutleca
Copy link
Contributor

A cleaner solution for your scenario would be the one described here microsoft/azure-pipelines-yaml#291

Unfortunately it seems that the pipeline resource triggers are not working as expected yet :(

@N-Usha N-Usha assigned N-Usha and kmkumaran and unassigned N-Usha Feb 27, 2020
@thesattiraju
Copy link

@ionutleca is this still a valid scenario for you?

@ionutleca
Copy link
Contributor

@DS-MS I didn't invest any more time into moving to GitHub actions from AzureDevOps, so no. But I think that anyone that has to make this transition, will need these basic features (pass variables, select target branch, etc.)

@Josh-01 Josh-01 added enhancement New feature or request idle Inactive for 14 days labels Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request idle Inactive for 14 days
Projects
None yet
Development

No branches or pull requests

6 participants