Skip to content
A GitHub Action that uploads a file to a new release.
Shell Dockerfile
Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
Branch: master
Clone or download

Latest commit

JasonEtco Merge pull request #16 from c-brooks/patch-1
Add `-f` flag to curl command
Latest commit d648f1b Jan 17, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
Dockerfile Init to winit Dec 4, 2018
LICENSE Init to winit Dec 4, 2018
README.md Add section to README reinforcing the need to use the release event type Oct 16, 2019
action.yml Create action.yml Oct 16, 2019
upload-to-release Add `-f` flag to curl command Jan 17, 2020

README.md

Upload to Release

A GitHub Action that uploads a file to a new release.

Usage

This action uploads any file to a new release:

image

One example workflow is to build and save a Docker image then upload it to a release:

# .github/workflows/build-docker-image.yml
name: build-docker-image

on: release

jobs:
  build-docker-image:
    name: Build and upload docker image
    runs-on: ubuntu-latest
    steps:
      - name: Pull source
        uses: actions/checkout@v1

      - name: Build Docker image
        uses: actions/docker/cli@master
        with:
          args: build . -t my-image

      - name: Save the image
        uses: actions/docker/cli@master
        with:
          args: save my-image:latest

      - name: Upload to release
        uses: JasonEtco/upload-to-release@master
        with:
          args: my-image.tar
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Requirements

You must pass at least one argument, the path to the file you want to attach. You must also include the GITHUB_TOKEN secret, otherwise uploading the file will not work.

- name: Upload to release
  uses: JasonEtco/upload-to-release@master
  with:
    args: my-image.tar
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Content-Type

You may also need to pass an additional argument, the Content-Type header used when uploading your file (this is application/zip by default):

- name: Upload to release
  uses: JasonEtco/upload-to-release@master
  with:
    args: my-image.tar application/zip
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Event type

The event type your workflow is triggered from is critical to the function of this action. If you are not using on: release for your workflow this action will not work correctly.

The event sent to the action by GitHub only contains an artifact upload URL when using the release event type to trigger the workflow.

If you need other workflows not based on the release event, you should use multiple workflow definitions.

You can’t perform that action at this time.