question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support release asset patching behavior to overwrite existing release assets

See original GitHub issue

Hello, I’ve just discovered that the overwrite of already existing release assets of a existing release tag/name is not handled properly. The GitHub action just fails silent with not handled promise rejection warnings (why not errors?) and returns a success state, which is incorrect and should be failing!

The problem occurs in one of my nightly build and release GitHub workflows, which updates the same release tag/name with rebuild binaries, but the binaries are not updated at all. The following log message depicts the not handled promise rejection warning:

(node:2698) UnhandledPromiseRejectionWarning: HttpError: Validation Failed:
{"resource":"ReleaseAsset","code":"already_exists","field":"name"}
  at /home/runner/work/_actions/softprops/action-gh-release/v1/dist/index.js:1:273881
  at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2698) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
This error originated either by throwing inside of an async function without a 
catch block, or by rejecting a promise which was not handled with .catch(). 
(rejection id: 1)

The issue and feature request is similar to #42, which describes a merging of assets, but not explicit overwrite. Maybe an option (e.g. asset) can be introduced in the GitHub action configuration to set different GitHub release patch behaviors.

  • asset: create represents the current and default behavior, but shall fail if the asset already exists
  • asset: patch represents a new behavior to overwrite only existing assets
  • asset: merge represents a new behavior to overwrite existing and add new ones as well, so a combination of create and patch, which shall cover the issue in #42 as well.

A workflow example configuration would look like:

    - name: Release
      uses: softprops/action-gh-release@v1
      with:
        files: "artifacts/**"
        asset: patch
        tag_name: nightly
        name: nightly
        draft: false
        prerelease: true
        body: |
          Nightly release
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:18
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ppaulwebercommented, Oct 5, 2020

@proddy yes, I use another action to erase the existing release and then create a new one, but I would rather like to “re-release” to the same tag as proposed in this issue.

1reaction
proddycommented, Jan 26, 2021

I just ran into this as well.

I used delete-tag-and-release as in https://github.com/proddy/EMS-ESP/blob/dev/.github/workflows/build_firmware.yml

sloppy, but it kinda works

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support release asset patching behavior to overwrite existing ...
Hello, I've just discovered that the overwrite of already existing release assets of a existing release tag/name is not handled properly.
Read more >
Github UPDATE / OVERWRITE existing asset of a release
I am using Github Api to get upload url of latest release assets (username and token is optional here). upload_url=$(curl -sL userName:token ...
Read more >
Releases - GitLab Docs
In GitLab, a release enables you to create a snapshot of your project for your users, including installation packages and release notes.
Read more >
Patching with AssetBundles - Unity - Manual
Patching AssetBundles is as simple as downloading a new AssetBundle and replacing the existing one. If WWW.LoadFromCacheOrDownload or UnityWebRequest are used ...
Read more >
SysAid Patch Management Guide
The patch perspective involves applying a specific patch on multiple assets and observing the behavior of the patch. Alternatively, the asset ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found