upload-release-assets
upload-release-assets copied to clipboard
Cannot read properties of undefined
Uploading any file, for example as follows:
jobs:
build:
steps:
- uses: AButler/[email protected]
with:
files: "my_file.txt"
repo-token: ${{ secrets.GITHUB_TOKEN }}
leads to the following error:
Error: Cannot read properties of undefined (reading 'id')
I had the same issue, you can fix it by explicitly passing a value to release-tag:
- name: ⬆️ Upload the assets
uses: AButler/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
files: "dist/*;LICENSE"
release-tag: ${{ github.ref_name }}
It's also possible to fix it using release-id, you will need to send an HTTP GET request to GitHub Public API and parse the JSON response though.
The fallback of this action may work differently depending on the workflow and might not work with the configurations you and I have.
Also, make sure to have contents write permission:
jobs:
publish:
permissions:
contents: write