0
0
mirror of https://github.com/saltstack-formulas/salt-formula.git synced 2025-12-25 00:00:26 +01:00
salt-formula/pre-commit_semantic-release.sh

36 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
###############################################################################
# (A) Update `FORMULA` with `${nextRelease.version}`
###############################################################################
sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA
###############################################################################
# (B) Update `AUTHORS.md`
###############################################################################
maintainer contributor \
--ignore-contributors dependabot[bot],renovate[bot],semantic-release-bot
###############################################################################
# (C) Use `m2r` to convert automatically produced `.md` docs to `.rst`
###############################################################################
# Copy and then convert the `.md` docs
cp ./*.md docs/
cd docs/ || exit
m2r --overwrite ./*.md
# Change excess `H1` headings to `H2` in converted `CHANGELOG.rst`
sed -i -e '/^=.*$/s/=/-/g' CHANGELOG.rst
sed -i -e '1,4s/-/=/g' CHANGELOG.rst
# Use for debugging output, when required
# cat AUTHORS.rst
# cat CHANGELOG.rst
# Return back to the main directory
cd ..