Skip to content

Commit bc299a2

Browse files
authored
chore: Add script to verify release notes (#437)
1 parent a6a2382 commit bc299a2

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,16 @@ repos:
103103

104104
- id: cargo-rustfmt
105105
name: cargo-rustfmt
106+
files: \.rs$
106107
language: system
107108
# Pinning to a specific rustc version, so that we get consistent formatting
108109
entry: cargo +nightly-2025-05-26 fmt --all -- --check
109110
stages: [pre-commit]
110111
pass_filenames: false
112+
113+
- id: ./scripts/verify_release_notes
114+
name: ./scripts/verify_release_notes
115+
language: system
116+
entry: ./scripts/verify_release_notes.sh
117+
stages: [pre-commit, pre-merge-commit, manual]
118+
pass_filenames: false

scripts/verify_release_notes.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
STACKABLECTL_VERSION=$(grep 'version' "./rust/stackablectl/Cargo.toml" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
6+
[ -n "$STACKABLECTL_VERSION" ] || (
7+
echo "CRATE_VERSION for is empty." >&2
8+
echo "Please check ./rust/stackablectl/Cargo.toml" >&2
9+
exit 1
10+
)
11+
12+
RELEASE_NOTES_FILE="./docs/modules/stackablectl/partials/release-notes/release-${STACKABLECTL_VERSION}.adoc"
13+
14+
if [ ! -f "$RELEASE_NOTES_FILE" ]; then
15+
echo "$RELEASE_NOTES_FILE does not exist, please create it and add the appropriate content" >&2
16+
exit 1
17+
fi

0 commit comments

Comments
 (0)