Search code examples
githubazure-devopsazure-pipelinesgithub-actions

How can I get status of an Azure Classic pipeline which is currently running, in GitHub?


Scenario: Salesforce DevOps

Pipelines are set-up in Azure DevOps and repositories have been migrated to GitHub.

Process: As soon as someone raises a pull request against master branch, an Azure Pipeline is triggered which validated the committed components against a sandbox. What is the best way where I can see the status of this triggered pipeline in GitHub. Current setup: After raising PR, every dev has to go to Azure and check whether pipeline is succeeding or not, which in case missed by someone can cause inconsistency in code and overall release process.

From what I've learned, we can get status of completed runs of pipeline from Azure REST API. I am fairly new to this and any help would be appreciated.

Thank you!

Tried to get status of Azure Pipeline through Git Workflow couldn't figure out exact steps.


Solution

  • If the DevOps classic pipeline is triggered by the PR on github, you should have enabled PR trigger as below in DevOps pipeline:

    enter image description here

    It will report the build result/state to Github PR automatically.

    enter image description here

    If you still would like to use rest api to get the DevOps pipeline status, please check my answer here.

    Edit: Add the detail solution:

    1. Check the service connection -> security -> Make sure the pipeline is not restricted.

    2. unchecked CI option -> saved -> enabled CI option again, it fixed the status check.