Skip to content

Release pipeline always retrieves master/main branch when not triggered manually #32

@renzo-cast

Description

@renzo-cast

summary

We are using this marketplace module to enable our release pipelines to consume GHE repositories as artifacts.

We have identified an issue where releases triggered by the REST API will always checkout the master branch of the GHE repository artifact even when a non-master branch is selected as the default branch.
Interestingly the artifact UI also shows the correct branch although the Commit ID referenced is from master instead of the branch.

image

Notes on this bug:

  • This does not occur when the release is triggered manually via the UI, in that scenario the non-master branch is correctly checked out.
  • We are not specifying any artifact details in our REST API call (see example below). We just want it to use the default branch

To Reproduce:

  1. Create a release pipeline
  2. specify a GHE repository as an artifact
  3. specify a non-master branch as the default branch
  4. create a release manually - the non-master branch should be checked out
  5. create a release using the REST API - the master branch will be checked out even though the UI shows the non-master branch
    az rest --method post --url https://vsrm.dev.azure.com/<organization>/<project>/_apis/release/releases?api-version=6.0 --body '{"definitionId": <release-definitionId>}'

Actual behavior

The master branch is always checked out.

Expected behavior

The non-master branch should be checked out.

Other details

Azure DevOps Type: Azure DevOps Services

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions