Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read properties of undefined #42

Open
hirrolot opened this issue Jun 1, 2024 · 1 comment
Open

Cannot read properties of undefined #42

hirrolot opened this issue Jun 1, 2024 · 1 comment

Comments

@hirrolot
Copy link

hirrolot commented Jun 1, 2024

Uploading any file, for example as follows:

jobs:
  build:
    steps:
      - uses: AButler/upload-release-assets@v3.0
        with:
          files: "my_file.txt"
          repo-token: ${{ secrets.GITHUB_TOKEN }}

leads to the following error:

Error: Cannot read properties of undefined (reading 'id')
@EchoEllet
Copy link

EchoEllet commented Jun 22, 2024

I had the same issue, you can fix it by explicitly passing a value to release-tag:

      - name: ⬆️ Upload the assets
        uses: AButler/upload-release-assets@v3.0
        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

de-ich added a commit to de-ich/vws4ls-aaspe-plugin that referenced this issue Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants