Azure / pipelines

Enable GitHub developers to trigger Azure Pipelines from a GitHub Actions workflow
MIT License
73 stars 83 forks source link

[Bug] Does not allow to parameterize the repository resource ref attribute when the resources are inside an extended template. #82

Closed MarkKharitonov closed 10 months ago

MarkKharitonov commented 1 year ago

Consider the following simple pipeline consisting of two small YAML files: run.yaml

trigger: none

extends:
  template: do-run.yaml
  parameters:
    master_branch: publish_test

do-run.yaml

parameters:
  - name: master_branch
    default: master

resources:
  repositories:
    - repository: chip_aks_helmcharts
      type: git
      name: CHIP/chip_aks_helmcharts
      ref: ${{ parameters.master_branch }}
      # https://dev.azure.com/CeridianHosting/CHIP/_git/chip_aks_helmcharts

steps: []

The pipeline link is https://dev.azure.com/CeridianHosting/CHIP/_build?definitionId=695

The code is on the test branch. Trying to run the pipeline results in

/test_yaml_extends/run.yaml: Internal error reading the template. Expected a scalar, a sequence, or a mapping

image

  1. If I replace ref: ${{ parameters.master_branch }} with ref: publish_test, then queuing the build works fine. (this is the master branch)
  2. If I inline the do-run.yaml, i.e. not use the YAML extension feature (branch no_extended_yaml) then I can queue the build just fine and modify the ref attribute.

So it seems that the parametrization of the ref attribute is not possible when the resources are declared inside the extended YAML.

tjcorr commented 10 months ago

This repository only covers the GitHub Action: Azure/pipelines Other Azure DevOps questions can be raised via a support ticket or through the community hub: https://techcommunity.microsoft.com/t5/azure-devops/bd-p/AzureDevOpsForum