New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: update version in docs & sec pol on release #1293
Conversation
set -euo pipefail | ||
|
||
version=$(cat version.txt) | ||
sed -i "s/\\(git clone.*--branch \\).*\\(\`.*|\\)/\\1v$version\\2/" docs/guide/getting-started.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does $version
need to be escaped before being used in the sed
expression?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case no (works locally 😅), I am no sed
expert but perhaps it is because it's in the RHS of the substitution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, on the RHS I guess we don't have to worry about .
becoming a wildcard.
if ! grep -q "$version_major_minor_x" SECURITY.md; then | ||
# prepend new version to the list | ||
sed -i "s/white_check_mark:/x: /g" SECURITY.md | ||
sed -i "s/^\\(| -* | -* |\\)$/\\1\\n| $version_major_minor_x | :white_check_mark: |/" SECURITY.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whitespace for the newline is not perfect, but not too messy and the markdown rendering of GitHub resolves the table correctly regardless of whitespace. It's not perfect as version # character length changes across versions 0.9.0
=> 0.10.0
etc.
Summary
sed
for replacing version indocs/guide/getting-started
page. Move to standalone script for easier dev testingmajor.minor
version is found as the current list does not track patch releases. Exec this script in the same CI pipeline as documentation version update so there is only a single auto-commit and avoid potential git race conditions of multiple updates from different jobs or workflows.scripts/
filestest/yml
use Bats version from repo.tool-versions
file and not hardcoded in tests workflow (we're not installing deps in thetest.yml
workflow via the asdf GH Action as it conflicts with tests somehow/somewhere. probably worth fixing one day).Other Information
I believe this will fix the issues with auto-docs updating defined in #1000 & trigger fixed in #1232