Skip to content

Latest commit

 

History

History
64 lines (53 loc) · 2.37 KB

File metadata and controls

64 lines (53 loc) · 2.37 KB

Upload a release asset

A composite action that uploads an asset to a Github release. Requires the issues: write permission to work.

Inputs

Name Description Default
name (*) The name to give this artifact. Must be unique. N/A
path (*) Path to the file that will be used as a release artifact N/A
release-id (*) The ID of the release N/A
github-token The default token to use for this Git operation. If unspecified, this will default to github.token. "${{ github.token }}"
owner The repository owner. If unspecified, this will default to the owner of the current repository. ""
repo The name of the repository. If unspecified, this will default to the current repository. ""
retries The number of times to attempt to retry if this fails. "0"
retry-exempt-status-codes A list of error-codes that are exempt from being retried. "400,401,403,404,422"

Note: (*) marks required inputs

Outputs

Name Description
asset-api-url The API URL of the uploaded asset
asset-id The ID of the created asset
asset-url The browser URL of the uploaded asset

Example

Here is a very basic example of how to use the releases/upload-asset composite action in a project (placeholders are used in place of real inputs):

run:
  example-job:
    # ... 
    steps:
      # ... 
      - name: Upload a release asset
        id: releases-upload-asset # only necessary if using this action's output(s)
        uses: bitwizeshift/actions-github/releases/upload-asset@v1
        with:
          # Required inputs
          name: NAME
          path: PATH
          release-id: RELEASE_ID

          # Optional inputs
          github-token: GITHUB_TOKEN
          owner: OWNER
          repo: REPO
          retries: RETRIES
          retry-exempt-status-codes: RETRY_EXEMPT_STATUS_CODES
      # ... 
      - name: Uses "Upload a release asset" Outputs
        uses: example-actions/use-releases-upload-asset@v3 # illustrative
        with:
          use-asset-api-url: ${{ steps.releases-upload-asset.outputs.asset-api-url }}
          use-asset-id: ${{ steps.releases-upload-asset.outputs.asset-id }}
          use-asset-url: ${{ steps.releases-upload-asset.outputs.asset-url }}