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 all artifacts to be removed before updating release #108

Closed
Rosalie241 opened this issue Aug 30, 2021 · 1 comment · Fixed by #109
Closed

Allow all artifacts to be removed before updating release #108

Rosalie241 opened this issue Aug 30, 2021 · 1 comment · Fixed by #109

Comments

@Rosalie241
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I want to be able to have 1 release for github actions where my artifacts have a different filename each time the action is run.
Right now it just keeps adding artifacts to the same release, see https://github.com/Rosalie241/GLideN64/releases/tag/github-actions

Describe the solution you'd like
An option which'd remove all artifacts from the release before uploading the artifacts would be perfect.
I'm not really familiar with typescript/javascript (hence why I didn't open a PR) but I think something like this code should work?

private async deleteArtifactsFromRelease(releaseId: number): Promise<void> {
    const releaseAssets = await this.releases.listArtifactsForRelease(releaseId)
    for (const artifact of releaseAssets) {
        core.debug(`Deleting existing artifact ${artifact.name}...`)
        await this.releases.deleteArtifact(artifact.id)
    }
}

Describe alternatives you've considered
I've considered keeping the filename the same but that isn't ideal.

Additional context
https://github.com/Rosalie241/GLideN64/blob/master/.github/workflows/build.yml#L198-L230
https://github.com/Rosalie241/GLideN64/releases/tag/github-actions

@ncipollo
Copy link
Owner

v1 and v1.8.9 now contain this feature. Thanks again for the PR!

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.

2 participants