release/1.0.6 #28
1 changed files with 14 additions and 7 deletions
Merge pull request 'ci(forgejo): check CHANGELOG channel suffix on the section title' (#26) from fix/forgejo-release-changelog-title-check into release/1.0.6
Some checks failed
Forgejo Release / release (push) Failing after 13s
Some checks failed
Forgejo Release / release (push) Failing after 13s
Reviewed-on: #26
commit
69677727cb
|
|
@ -125,13 +125,17 @@ jobs:
|
|||
# Extraction de la section [TAG]. On cherche la première ligne
|
||||
# commençant par '## [' qui contient '[TAG]' (entre '## [' et
|
||||
# la prochaine ligne '## [' ou fin de fichier). awk en mode
|
||||
# paragraphe suffit et reste POSIX.
|
||||
# paragraphe suffit et reste POSIX. On garde aussi le titre
|
||||
# (ligne `## [TAG] - channel`) pour la vérification du canal.
|
||||
BODY=$(awk -v tag="[$TAG]" '
|
||||
/^## \[/ {
|
||||
if (in_section) exit
|
||||
if (index($0, tag) > 0) in_section=1
|
||||
if (index($0, tag) > 0) {
|
||||
in_section=1
|
||||
print
|
||||
next
|
||||
}
|
||||
}
|
||||
in_section { print }
|
||||
' CHANGELOG.md)
|
||||
|
||||
|
|
@ -143,13 +147,16 @@ jobs:
|
|||
|
||||
# Vérification cohérence du canal déclaré dans le suffixe.
|
||||
# Format attendu : "## [TAG] - stable" / "- preview" / "- unstable".
|
||||
if [[ "$BODY" != *" - $CHANNEL"* ]]; then
|
||||
echo "::error::Section '## [$TAG]' must declare suffix '- $CHANNEL' to match tag parity."
|
||||
echo "Current section body (first 5 lines):"
|
||||
echo "$BODY" | head -5
|
||||
# On lit la première ligne du body qui contient le titre.
|
||||
TITLE=$(echo "$BODY" | head -1)
|
||||
if [[ "$TITLE" != *" - $CHANNEL"* ]]; then
|
||||
echo "::error::Section title '$TITLE' must declare suffix '- $CHANNEL' to match tag parity."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Body pour la release : retire la première ligne (titre).
|
||||
BODY=$(echo "$BODY" | tail -n +2)
|
||||
|
||||
echo "Section CHANGELOG validée pour [$TAG] - $CHANNEL"
|
||||
|
||||
# Expose channel + body pour les étapes suivantes via $GITHUB_ENV.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue