actions icon indicating copy to clipboard operation
actions copied to clipboard

Prevent update release if files didn't change

Open sormuras opened this issue 5 years ago • 2 comments

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.

sormuras avatar Oct 26 '20 17:10 sormuras

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?

marvinpinto avatar Mar 23 '21 13:03 marvinpinto

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.

sormuras avatar Mar 23 '21 16:03 sormuras