Skip to content

Latest commit

 

History

History
147 lines (113 loc) · 4.38 KB

resources-packages-package.md

File metadata and controls

147 lines (113 loc) · 4.38 KB
title description ms.date monikerRange
resources.packages.package definition
A package resource used to reference a NuGet or npm GitHub package.
03/02/2023
>=azure-pipelines-2020

resources.packages.package definition

:::moniker range=">=azure-pipelines-2020"

You can consume NuGet and npm GitHub packages as a resource in YAML pipelines. When specifying package resources, set the package as NuGet or npm.

:::moniker-end

:::moniker range=">=azure-pipelines-2020"

packages:
- package: string # Required as first property. Alias of package artifact.
  type: string # Required. Type of the package. Ex - NuGet, NPM etc.
  connection: string # Required. Name of the connection. This connection will be used for all the communication related to this artifact.
  name: string # Required. Name of the package.
  version: string
  tag: string
  trigger: none | true # Trigger a new pipeline run when a new version of this package is available.

:::moniker-end

:::moniker range=">=azure-pipelines-2020"

Definitions that that reference this definition: resources.packages

:::moniker-end

Properties

:::moniker range=">=azure-pipelines-2020"

package string. Required as first property.
Alias of package artifact. Acceptable values: [-_A-Za-z0-9]*.

:::moniker-end

:::moniker range=">=azure-pipelines-2020"

type string. Required.
Type of the package. Ex - NuGet, NPM etc.

:::moniker-end

:::moniker range=">=azure-pipelines-2020"

connection string. Required.
Name of the connection. This connection will be used for all the communication related to this artifact.

:::moniker-end

:::moniker range=">=azure-pipelines-2020"

name string. Required.
Name of the package.

:::moniker-end

:::moniker range=">=azure-pipelines-2020"

version string.

:::moniker-end

:::moniker range=">=azure-pipelines-2020"

tag string.

:::moniker-end

:::moniker range=">=azure-pipelines-2020"

trigger string.
Trigger a new pipeline run when a new version of this package is available. none | true.

:::moniker-end

Examples

In this example, there is an GitHub service connection named pat-contoso to a GitHub npm package named contoso. Learn more about GitHub packages.

resources:
  packages:
    - package: contoso
      type: npm
      connection: pat-contoso
      name: yourname/contoso 
      version: 7.130.88 
      trigger: true

pool:
  vmImage: ubuntu-latest

steps:
- getPackage: contoso 

See also