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.vforv1.2.3), for the repositories that already usev-prefixed tags.- The
dry-runjob also runs the prepare script with a mock version and fails if it didn't change any ofgit-assets. It auto-runs — even withoutdry-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 matchingworkflow:rulesentry (documented in the README). prepare-script,git-assetsandtag-prefixonly apply to the bundled configurations: combining them withconfiguration: local-configfails pipeline creation instead of being silently ignored.commit-messageis 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-configis combined with any of the three inputs above.
Related reference(s)
- helm component MR: helm!2 (merged)