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 removal for old releases #47

Closed
matklad opened this issue Mar 4, 2020 · 8 comments
Closed

Allow removal for old releases #47

matklad opened this issue Mar 4, 2020 · 8 comments

Comments

@matklad
Copy link

matklad commented Mar 4, 2020

Hi! I am looking to setup nightly releases for rust-analyzer, and for that I want to publish a github release every night under the same tag. IE, I want the tag itself to move. Looks like at the moment actions-gh-release silently fails in this case:


Release
1s
(node:2749) 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: 4)
Run softprops/action-gh-release@v1
⬆️ Uploading rust-analyzer-linux...
⬆️ Uploading rust-analyzer-windows.exe...
⬆️ Uploading rust-analyzer-mac...
⬆️ Uploading rust-analyzer.vsix...
🎉 Release ready at https://github.com/matklad/rust-analyzer/releases/tag/2020-03-04
(node:2749) 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:2749) 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)
(node:2749) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:2749) 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:2749) 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: 2)
(node:2749) 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:2749) 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: 3)
(node:2749) 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:2749) 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: 4)

Failing by default is probably the right behavior, but it would be cool if the action had an overwrite: boolean flag to control this behavior

@matklad matklad changed the title Allow removal for old releases! Allow removal for old releases Mar 4, 2020
@ame-yu
Copy link

ame-yu commented Mar 7, 2020

I have same problem.
In my case i want hava only one release for my repository which called latest
Now i write a action to delete my latest release

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Delete
        uses: ame-yu/action-delete-latest-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GITHUB_REPOSITORY: $ {{ github.repository }}

      - name: Release
        uses: softprops/action-gh-release@v1
        with:
          name: type-your-release-name
          tag_name: tag-here

https://github.com/ame-yu/action-delete-latest-release/tree/v1

@BotellaA
Copy link

@softprops What do you think about this feature? I would love to have an overwrite option!

@ppaulweber
Copy link

@matklad I've had a similar problem and already suggested a possible solution at #45 in order to represent an nightly release behavior as well. Furthermore, have a look at the issues #42 and #43 which have a quite similar problem.

@greggameplayer
Copy link

For me it would also be good to have an overwrite feature

@proddy
Copy link

proddy commented Oct 4, 2020

me too

@brianpham
Copy link

I would like this too. +1

We are currently using the same tag for releases and as a workaround, we need to delete the tags before it gets push again.

@JustinGrote
Copy link

I would like behavior similar to release drafter where on every main commit I can have a draft release added that updates with the latest release notes, and when I publish the release it triggers my github action to deploy.

Release drafter doesn't let me specify my own release notes however which is why I came here. As a workaround I am deleting the release prior to publishing.

https://github.com/marketplace/actions/release-drafter

@softprops
Copy link
Owner

from the error in the description it seems this is more related to assets than the release itself. upserting assets is now the default which should fix this issue

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

9 participants