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

Draft releases erroring as "Malformed version" #38

Closed
guilhermeblanco opened this issue Apr 19, 2022 · 5 comments · Fixed by #40
Closed

Draft releases erroring as "Malformed version" #38

guilhermeblanco opened this issue Apr 19, 2022 · 5 comments · Fixed by #40

Comments

@guilhermeblanco
Copy link

Opening this as issue after suggested by author on #36 (comment)

This issue started happening once PR #36 got merged.

It seems that since we now assume a well-formed version as part of the getRelease function, it completely ignored the scenario where you may be downloading draft assets (which means release version is "untagged-XXX", for example: untagged-f8c3edf8af6344f60679).

What we experience now is a "Malformed version" error when attempting to download assets, as shown in the picture below.

Screenshot from 2022-04-19 10-31-15

Here is a sample that reflects how we do with drafts:

name: build-artifact

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Draft new release
        id: draft_release
        uses: release-drafter/release-drafter@v5
        with:
          config-name: release-drafter.yml
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Upload assets
        id: upload_assets
        run: |
          gh release upload --clobber ${{ env.VERSION }} ${{ env.FILES }}
        env:
          GITHUB_TOKEN: ${{ secrets.GIT_PERSONAL_TOKEN }}
          VERSION: ${{ steps.draft_release.outputs.tag_name }}
          FILES: |
            release_asset.jar

    outputs:
      release_id: ${{ steps.draft_release.outputs.id }}
      release_name: ${{ steps.draft_release.outputs.name }}
      release_tag: ${{ steps.draft_release.outputs.tag_name }}
      release_url: ${{ steps.draft_release.outputs.html_url }}
      release_body: ${{ steps.draft_release.outputs.body }}
      release_upload_url: ${{ steps.draft_release.outputs.upload_url }}

  release:
    runs-on: ubuntu-latest
    needs: build

    steps:
      - name: Download release asset
        id: download_asset
        uses: dsaltares/fetch-gh-release-asset@master
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          version: ${{ needs.build.outputs.release_id }}
          file: release_asset.jar
          target: release_asset.jar
@devedse
Copy link

devedse commented Apr 19, 2022

Yep I'm having the same issue.

@guilhermeblanco
Copy link
Author

@devedse Temporary solution is to pin the action to version 0.0.8, like this:

      - name: Download release asset
        id: download_asset
        uses: dsaltares/[email protected]
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          version: ${{ needs.build.outputs.release_id }}
          file: release_asset.jar
          target: release_asset.jar

@devedse
Copy link

devedse commented Apr 19, 2022

Yep that's what I did as well.

@adermrc
Copy link

adermrc commented Apr 20, 2022

We have the same problem, workaround works.
Regards Marco

@umireon
Copy link
Contributor

umireon commented Apr 21, 2022

#40 will fix this bug

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

Successfully merging a pull request may close this issue.

4 participants