Skip to content

Conversation

@jacopocarlini
Copy link

SUMMARY
Add template parameters to the task

DETAILS

Allowing the user to specify the template parameters of the pipeline.

example of usage:

- uses: Azure/pipelines@v1
  with:
    azure-devops-project-url: 'https://dev.azure.com/organization/project-name'
    azure-pipeline-name: 'pipeline-name' # name of the Azure pipeline to be triggered
    azure-devops-token: '${{ secrets.AZURE_DEVOPS_TOKEN }}'
    azure-pipeline-variables:  '{"variable1": "value1", "variable2": "value2"}' # optional stringified json
    azure-template-parameters: '{"variable1": "value1", "variable2": "value2"}' # optional stringified json

@ghost
Copy link

ghost commented May 19, 2022

CLA assistant check
All CLA requirements met.

@jessetan
Copy link

Is there any progress on this PR? It would be great to be able to pass pipeline parameters in the action

@danielkimuipath
Copy link

Is there any update for this?

# Conflicts:
#	action.yml
#	lib/main.js
#	lib/pipeline.error.js
#	lib/pipeline.runner.js
#	lib/task.parameters.js
#	lib/util/logger.js
#	lib/util/pipeline.helper.js
#	lib/util/url.parser.js
@jacopocarlini
Copy link
Author

jacopocarlini commented Sep 29, 2023

at the moment you can use my repository:

- name: Azure Pipelines Action - Jversion
  uses: jacopocarlini/[email protected]
  with:
    azure-devops-project-url: 'https://dev.azure.com/organization/project-name'
    azure-pipeline-name: 'pipeline-name' # name of the Azure pipeline to be triggered
    azure-devops-token: '${{ secrets.AZURE_DEVOPS_TOKEN }}'
    azure-pipeline-variables:  '{"variable1": "value1", "variable2": "value2"}' # optional stringified json
    azure-template-parameters: '{"variable1": "value1", "variable2": "value2"}' 

@priscofarina
Copy link

priscofarina commented Apr 15, 2024

Hi guys,
when this feature will be released?
As far as I got the possibility to pass parameters should be already available in the release v1.2 but I still see problems while using it.

Tks

@jacopocarlini
Copy link
Author

Hi @priscofarina,
there isn't the official support for this feature at the moment. You can use my action (v1.4) #63 (comment)

@nidhin077
Copy link

nidhin077 commented Apr 21, 2025

@tjcorr I have tried using the latest version of the action to pass a variable to the Azure pipeline, but it doesn’t seem to be passing the value correctly. I’ve attached the workflow I’m currently using. Could you please review it and let me know if there’s anything I might have misconfigured?


name: Trigger Azure DevOps Pipeline on GitHub Release

on:
  release:
    types: [published]
  workflow_dispatch:

jobs:
  trigger-devops-pipeline:
    runs-on: ubuntu-latest

    steps:
      - name: Print GitHub Tag
        run: |
           echo "📦 GitHub Tag: ${{ github.event.release.tag_name }}"

      - name: Trigger Azure DevOps Pipeline
        uses: tjcorr/[email protected]
        with:
          azure-devops-project-url: https://dev.azure.com/${{ vars.AZURE_DEVOPS_ORG }}/${{ vars.AZURE_DEVOPS_PROJECT }}
          azure-pipeline-name: '${{ vars.AZURE_DEVOPS_PIPELINE }}'
          azure-devops-token: ${{ secrets.AZURE_DEVOPS_PAT }}
          azure-pipeline-variables: >-
             {
               "GIT_TAG": "${{ github.event.release.tag_name }}"
              }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants