Skip to content

Download an artifact from any prior workflow run of a given repository.

License

Notifications You must be signed in to change notification settings

james-perfectserve/download-prior-artifact

 
 

Repository files navigation

GitHub Action: Download Prior Artifact

download-prior-artifact status

Download an artifact from any prior workflow run of a given repository.

This action exists because actions/download-artifact can only download artifacts from within the same workflow run.

Use actions/upload-artifact as normal to upload artifacts for this action to retrieve.

Usage

See action.yml

Current repository (default):

steps:
  - uses: actions/checkout@v2

  - uses: alextompkins/download-prior-artifact@v1
    with:
      name: my-artifact-id-123
      path: path/to/artifact
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  - name: Display structure of downloaded files
    run: ls -R

Another repository:

steps:
  - uses: actions/checkout@v2

  - uses: alextompkins/download-prior-artifact@v1
    with:
      repo: actions/upload-artifact
      name: my-artifact-id-123
      path: path/to/artifact
    env:
      GITHUB_TOKEN: {{ secrets.ACTION_GITHUB_TOKEN }}

  - name: Display structure of downloaded files
    run: ls -R

For this to work you must provide GITHUB_TOKEN with a token which has access to the given repo. The default GITHUB_TOKEN only has access to the repo it is running in.

About

Download an artifact from any prior workflow run of a given repository.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 95.3%
  • JavaScript 4.7%