# https://docs.microsoft.com/en-us/azure/devops/release-notes/2020/pipelines/sprint-172-update#generic-webhook-based-triggers-for-yaml-pipelines
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/resources?view=azure-devops&tabs=schema

resources:
  webhooks:
    - webhook: MyWebhookTrigger ### Webhook alias
      connection: powershellScriptsWebHookServiceConnection ### Incoming webhook service connection
      # filters:
      #   - path: repositoryName ### JSON path in the payload
      #     value: maven-releases ### Expected value in the path provided
      #   - path: action
      #     value: CREATED

pool:
  name: self-hosted
  
steps:
  - task: PowerShell@2
    inputs:
      targetType: "inline"
      ### JSON payload data is available in the form of ${{ parameters.<WebhookAlias>.<JSONPath>}}
      script: |
        Write-Host ${{ parameters.MyWebhookTrigger.repositoryName}}
        Write-Host ${{ parameters.MyWebhookTrigger.component.group}}

# https://docs.microsoft.com/en-us/azure/devops/release-notes/2020/pipelines/sprint-172-update#generic-webhook-based-triggers-for-yaml-pipelines
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/resources?view=azure-devops&tabs=schema

resources:
  webhooks:
    - webhook: esrp-oss-proxy-web-hook-trigger ### Webhook alias
      connection: esrp-oss-proxy-web-hook-connection ### Incoming webhook service connection
      # filters:
      #   - path: repositoryName ### JSON path in the payload
      #     value: maven-releases ### Expected value in the path provided
      #   - path: action
      #     value: CREATED

pool:
  name: self-hosted
  
steps:
  - task: PowerShell@2
    inputs:
      targetType: "inline"
      ### JSON payload data is available in the form of ${{ parameters.<WebhookAlias>.<JSONPath>}}
      script: |
        Write-Host ${{ parameters.MyWebhookTrigger.repositoryName}}
        Write-Host ${{ parameters.MyWebhookTrigger.component.group}}

Set up CI with Azure Pipelines
Set up CI with Azure Pipelines

[skip ci]