Add commit-back support, tag prefix and prepare check

  • ⚠️🤖 This MR has been automatically generated and must be reviewed by the assignee

What does this MR do and why?

Let repositories change files at release time, before the tag is created, without per-repo .releaserc plumbing. This is meant for repositories that reference themselves (a pre-commit hook pointing at the image built from its own tag, a chart deploying its own container, ...). First consumer: the helm component (helm!2 (merged)).

Also expose some more parameters to prepare for the migration of all sylva-elements repositories.

Add a "default" config (copied from sylva-element) and use it by default instead of local-config ( we don't have any repo using local-config ). Since we can now parametrize the config from the component, I don't see a reason to keep maintaining multiple config from this repos. component and sylva-element are kept for backward compatibility.

Summary

  • New inputs prepare-script, git-assets, commit-message, prepare-on-no-change, tag-prefix: repositories that reference themselves can have the release update those references (a hook entry, an image tag in a chart, ...). The script runs with the next version, the listed files are committed before the tag, and the tag lands on that commit so the files are correct at the tag. Nothing runs or is committed unless configured.
  • tag-prefix (e.g. v for v1.2.3), for the repositories that already use v-prefixed tags.
  • The dry-run job also runs the prepare script with a mock version and fails if it didn't change any of git-assets. It auto-runs — even without dry-run: true — when the script or one of the assets changes, so the release-commit content is validated before the first real release.
  • The release commit uses [skip ci on branch] instead of [skip ci], which would also skip the tag pipeline. Consumers must add the matching workflow:rules entry (documented in the README).
  • prepare-script, git-assets and tag-prefix only apply to the bundled configurations: combining them with configuration: local-config fails pipeline creation instead of being silently ignored. commit-message is the exception: its default is never empty, so an explicit value cannot be told apart and it stays ignored.

Testing

  • bats scripts/test/ (80 tests); tests/commit-back/ holds a minimal example script used by the tests and by this repo's self-tests.
  • End-to-end on helm-component-release-test (its include targets this branch): releases created with the release commit carrying the marker, the tag on that commit, the file content correct at the tag, no branch pipeline for the release commit and a running tag pipeline.
  • Pipeline creation is rejected when local-config is combined with any of the three inputs above.
Edited by Jonathan GAYVALLET

Merge request reports

Loading
Loading