Upload files to a GitHub release.
# …
steps:
# …
- name: Upload to release
uses: cloudnode-pro/release-upload-asset@1.0.2
with:
# See the ‘Inputs’ section below for details.
gh-token: ${{ github.token }}
release-id: 123456 # Optional for `release` events.
files: |
path/to/file.txt; type=text/plain; name=File1.txt
path/to/foo/bar.baz; if=${{ github.event_name == 'release' }}
The GitHub token to use for authentication.
If you are uploading to a release in the same repository, you can use ${{github.token}}
, which is a secret
generated by the workflow. Otherwise, you need to manually create a token, save it as a repository secret, and pass it
using ${{secrets.NAME_OF_SECRET}}
.
The ID of the release to which to upload files.
This is optional for release
events, in which case the ID can be inferred (if left unset) from the release that
triggered the workflow.
Paths to the files to upload. Separated by newline.
After the file path, you can add parameters separated by semicolons.
The recognised parameters are:
type
- The MIME type of the file. Defaults to
application/octet-stream
. name
- The name of the file. Defaults to the basename of the file path.
if
- Whether to actually upload this file. You can use this in combination with
GitHub expressions.
The allowed values are
true
andfalse
. Defaults totrue
.
Examples:
files: |-
/path/to/file1.txt
/path/to/file2.txt; type=text/plain; name=Named File.txt
/path/to/file3.txt; if=${{ 'foo' == 'bar' }}