mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-07-13 14:52:12 -04:00
ci(changelog): exclude changelog commits and fix contributor duplication (#5638)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
9
.github/workflows/update-changelog.yml
vendored
9
.github/workflows/update-changelog.yml
vendored
@@ -95,8 +95,8 @@ jobs:
|
||||
echo "$body" \
|
||||
| sed '/^<!-- .* -->/d' \
|
||||
| sed '/^## What'\''s Changed$/d' \
|
||||
| sed '/^## New Contributors$/,$d' \
|
||||
| sed '/^\*\*Full Changelog\*\*/d' \
|
||||
| sed '/^## New Contributors$/,$ { /^## New Contributors$/! { /^\*/!d; }; }' \
|
||||
| sed '/./,$!d' \
|
||||
| sed -e :a -e '/^\n*$/{$d;N;ba}'
|
||||
}
|
||||
@@ -107,6 +107,7 @@ jobs:
|
||||
gh api "repos/${REPO}/compare/${from_ref}...${to_ref}" \
|
||||
--jq '.commits[]
|
||||
| select(.parents | length == 1)
|
||||
| select((.commit.message | split("\n")[0] | ascii_downcase | test("update changelog(\\.md)?")) | not)
|
||||
| "* \(.commit.message | split("\n")[0]) by \(.commit.author.name) (@\(.author.login // .commit.author.name)) in [`\(.sha[0:9])`](https://github.com/'"${REPO}"'/commit/\(.sha))"' \
|
||||
2>/dev/null || true
|
||||
}
|
||||
@@ -125,7 +126,11 @@ jobs:
|
||||
|
||||
CONTRIBUTORS=""
|
||||
if echo "$FULL_NOTES" | grep -q '## New Contributors'; then
|
||||
CONTRIBUTORS=$(echo "$FULL_NOTES" | sed -n '/^## New Contributors$/,$ p')
|
||||
CONTRIBUTORS=$(echo "$FULL_NOTES" | awk '
|
||||
/^## New Contributors$/ { capture=1 }
|
||||
capture && /^\*\*Full Changelog\*\*/ { exit }
|
||||
capture { print }
|
||||
')
|
||||
fi
|
||||
|
||||
# === Build ordered segment chain by commit ancestry ===
|
||||
|
||||
Reference in New Issue
Block a user