Cross-platform GitHub action to upload multiple assets to a release using Golang.

Golang Github Actions

Features

  • Assets can be a global regex
  • Overwrite assets if wanted
  • Reverse (delete all uploaded assets) in case of failure if wanted
  • Output with colors and emojis

Requirements

This action could fail if there are no write permissions on contents.

permissions:
  contents: write

Arguments

All default values are passed if the action is used on a release event workflow, otherwise they missing ones need to be provided since the event associated might not have all the necessary values.

NameRequiredDefault valueDescription
filesalwaysPaths of the assets to be uploaded, it can be glob regex. It must be a string array. For example: files: '["my_asset", "*.py", "dist/*"]'
tokennogithub.tokenGitHub Acess Token. Picked automatically from github context.
tagyesgithub.event.release.tag_nameTag associated with the release where to upload the assets. Picked automatically from github context if the event that triggered the workflow is release, if not, it must be provided.
ownernogithub.repository_ownerOwner of Respository. Picked automatically from github context.
reponogithub.repositoryRepository where to upload assets. Picked automatically from github context.
workspacenogithub.workspaceWorkspace where to search the assets. Picked utomatically from github context.
overwrite_assetsnotrueOverwrite assets if they’re already in the release.
revert_on_failurenotrueRevert (delete all already uploaded assets) in case of failure.

Example

name: Test Upload Assets To Release on Release Event

on:
  release:
    types: [published]

jobs:
  test-upload-assets:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v3
      - name: Upload assets to release
        uses: ahsand97/[email protected]
        with:
          files: '["my_asset"]'