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

allow_override flag does not work for assets #2

Closed
majkrzak opened this issue Sep 15, 2019 · 10 comments
Closed

allow_override flag does not work for assets #2

majkrzak opened this issue Sep 15, 2019 · 10 comments

Comments

@majkrzak
Copy link

majkrzak commented Sep 15, 2019

Updating the release fails when asset is beeing updated:

    - uses: meeDamian/github-release@1.0
      with:
        token: ${{github.token}}
        commitish: ${{github.sha}}
        tag: latest
        name: Latest draft
        prerelease: true
        gzip: false
        files: >
          file.pdf:paper/paper.pdf
        allow_override: true
ERR: Uploading file.pdf to Github release has failed
{
  "message": "Validation Failed",
  "request_id": "07C0:5BBF:F7389:15503D:5D7E3EF4",
  "documentation_url": "https://developer.github.com/v3",
  "errors": [
    {
      "resource": "ReleaseAsset",
      "code": "already_exists",
      "field": "name"
    }
  ]
}

After manually removing the asset it seems that tag and commitsh was also not updated.

@majkrzak
Copy link
Author

I've recreated the action by myself
https://github.com/majkrzak/create-release

@meeDamian
Copy link
Owner

If I understand correctly, you have a latest release that you want to update with each new release - is that correct?

I don't think I've seen that pattern done on Github Releases before, is that a common thing?

@majkrzak
Copy link
Author

Yes, that's my case. I'm building the preview of the LaTeX paper when pushed to the master and publish it as the "Latest draft" preview release. Hadn't saw this approach before and maybe it is not perfect one but it fits my case 😄 Anyway the issue is that allow_override: true generally does not let you probably override more than body

@meeDamian
Copy link
Owner

It should allow you to override everything except assets and tag, as it's the main identifier.

I actually thought about asset override, but figured that if upload of an asset with the same name is attempted more than once, it's an error, that should be shown to the user. Guess not always 😅.

As for the other things, I'll do more testing to see what's going on.

@majkrzak
Copy link
Author

I'm not saying that my approach is correct. It sounds reasonable that assets are immutable. Maybe only in the "draft" release?

@meeDamian
Copy link
Owner

About tag and commitish - docs on them say that commitish is only used if git-tag doesn't exist. If it does exist, it's just used right away instead. And since git-tags and Github Releases, are not exactly the same thing, I'd say force pushing git tags (apart from being "The insane thing" according to git manual 😉), is also out of scope of this action :).

Plus seems like update action does work properly for other fields: https://github.com/meeDamian/github-release/commit/bb75309cfc0b7a207268b4a7a57eb66ef8e85e23/checks

https://github.com/meeDamian/github-release/releases/tag/v0.0.0-test-update

And I still have to think about overriding assets 🤔.

@meeDamian
Copy link
Owner

meeDamian commented Jan 14, 2020

@TomBrien
Copy link

TomBrien commented Apr 1, 2020

Please use https://github.com/actions/create-release and https://github.com/actions/upload-release-asset now instead.

Does this comment still apply? I see that the deprecation notice was removed a few days ago, and I agree with the new note! Problem with using actions/create-release and actions/upload-release-asset is it doesn't allow for overwriting releases. I think...

@majkrzak
Copy link
Author

majkrzak commented Apr 2, 2020

You can always go with mine 🤷‍♂️ https://github.com/majkrzak/create-release

@meeDamian
Copy link
Owner

Hey @TomBrien, I removed the deprecation, because the official alternative was just way to cumbersome :/. That being said I just made assets override possible with v2.0.1, if you haven't switched to @majkrzak's one in the meantime, please do let me know how it works for you :).

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

3 participants