https://github.com/git-for-windows/get-azure-pipelines-artifact
A GitHub Action that downloads and caches the specified artifact from a given Azure Pipeline
https://github.com/git-for-windows/get-azure-pipelines-artifact
actions github-actions
Last synced: about 1 year ago
JSON representation
A GitHub Action that downloads and caches the specified artifact from a given Azure Pipeline
- Host: GitHub
- URL: https://github.com/git-for-windows/get-azure-pipelines-artifact
- Owner: git-for-windows
- License: mit
- Created: 2021-03-24T16:25:02.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-22T03:11:02.000Z (about 1 year ago)
- Last Synced: 2025-04-22T05:28:13.962Z (about 1 year ago)
- Topics: actions, github-actions
- Language: TypeScript
- Homepage:
- Size: 21.9 MB
- Stars: 7
- Watchers: 5
- Forks: 6
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Download an artifact from an Azure Pipeline
Use this Action to download an artifact from an Azure Pipeline.
## Getting Started
```yaml
name: Download stuff from an Azure Pipeline
on: [push]
jobs:
build:
runs-on: ubuntu-16.04
steps:
- name: Download a build artifact from an Azure Pipeline
uses: git-for-windows/get-azure-pipelines-artifact@v0
with:
repository: git/git
definitionId: 10
artifact: sparse
- run: sudo dpkg -i sparse_*.deb
```
## Input parameters
### Repository
This Action needs to know in which repository the artifact lives. Example: [https://dev.azure.com/git/git/_build](https://dev.azure.com/git/git/_build) shows the Azure Pipelines of the `git/git` repository. It can be configured like this:
```yaml
- uses: git-for-windows/get-azure-pipelines-artifact@v0
with:
repository: git/git
```
### Pipeline definition ID
Every Azure Pipeline has a numerical identifier that is part of the URL. For example, the "Build sparse for Ubuntu" Pipeline in `git/git` at [https://dev.azure.com/git/git/_build?definitionId=10](https://dev.azure.com/git/git/_build?definitionId=10) has the identifier `10`. It needs to be configured via the `definitionId` key.
```yaml
- uses: git-for-windows/get-azure-pipelines-artifact@v0
with:
definitionId: 10
```
### Artifact name
Pipelines can have an arbitrary number of artifacts, which are identified by a name. The `artifact` parameter specifies which one to download. It can be omitted if the given Pipeline run has only one artifact attached to it.
### Build filters
The `reasonFilter` parameter can be added to filter by the reason for a build.
A list of accepted reasons can be found [here](https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/list?view=azure-devops-rest-6.0#buildreason). This parameter defaults to `all` if omitted.
### Strip prefix
Pipeline artifacts can contain entire directory structures. The `stripPrefix` parameter allows filtering by a given path prefix; Any files matching that prefix will be written (after stripping the prefix), all other files will be skipped.
### Output location
By default, the artifact files will be stored in the current directory. The `path` parameter can be used to override that.
This directory needs to be unless caching is turned off.
### Caching
To accelerate this Action, artifacts are cached once downloaded. This can be turned off by setting the input parameter `cache` to `false`.
## Developing _this_ Action
> First, you'll need to have a reasonably modern version of `node` handy, such as Node 12.
Install the dependencies
```bash
$ npm install
```
Build the Action and package it for distribution
```bash
$ npm run build && npm run package
```
Run the tests :heavy_check_mark:
```bash
$ npm test
```