Skip to content
This repository was archived by the owner on May 5, 2024. It is now read-only.

Prevent update release if files didn't change #49

Open
sormuras opened this issue Oct 26, 2020 · 2 comments
Open

Prevent update release if files didn't change #49

sormuras opened this issue Oct 26, 2020 · 2 comments

Comments

@sormuras
Copy link

It would be a nice-to-have feature if this action had an option to prevent a release update if none of the attached assets were changed compared to a previous release.

@marvinpinto
Copy link
Owner

Hello! I don't think I fully understand what you mean by prevent a release update, do you mean fail the build? Implying it should check the assets of the previous release and match md5sums, or something?

@sormuras
Copy link
Author

sormuras commented Mar 23, 2021

Hi, Marvin,

Thanks for coming back to this feature request.

Yeah, I think of it as a flag that users need to opt-in and is named like: release-only-if-assets-changed

It compares the assets of a previous release with those that would be attachted to the next release. If they don't match in number and in bytes (checksum), the release is performed as it is today. If they do match, the action entire action is an no-op, i.e. it skips the deletion, creation, and population of the next release.

Example

Perhaps an example helps to explain my idea better. Let's take https://github.com/sormuras/bach/releases - which uses this action to update the 17-ea tag on every push.

Usage: https://github.com/sormuras/bach/blob/418323156ad3329dd6071d6145ebb016cdc4215e/.github/workflows/ci.yml#L80-L88

So, every JAR file globbed from .bach/workspace/modules directory is being attached to the 17-ea release.

Release URL: https://github.com/sormuras/bach/releases/tag/17-ea

In the current state of the project, a single JAR file is produced by the CI workflow: [email protected]

Let's assume, that JAR file is reproducible 1:1. Meaning its bytes (checksum) only changes if a Java source file was changed.

If the release-only-if-assets-changed flag was set to true, an unrelated change (e.g. to the README.md file of the project), would not trigger a re-release of tag 17-ea, as the bytes (checksum) of the already attached [email protected] and the currently produced [email protected] are equal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants