mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-28 02:33:39 +01:00
fix changelog checker in CI to regex escape the submitter username
This commit is contained in:
parent
05ccdcd27b
commit
15178bca3f
12
.github/workflows/require-changelog-for-PRs.yml
vendored
12
.github/workflows/require-changelog-for-PRs.yml
vendored
@ -29,5 +29,15 @@ jobs:
|
||||
ADDED=$(git diff -U0 "origin/${PR_BASE}" HEAD -- CHANGELOG.md | grep -P '^\+[^\+].+$')
|
||||
echo "Added lines in CHANGELOG.md:"
|
||||
echo "$ADDED"
|
||||
|
||||
escape_regex_meta_chars() {
|
||||
# https://stackoverflow.com/a/16951928/4473405
|
||||
sed 's/[][\.|$(){}?+*^]/\\&/g' <<< "$*"
|
||||
}
|
||||
|
||||
double_escape_slash_for_bash() {
|
||||
sed 's/\\/\\\\/g' <<< "$*"
|
||||
}
|
||||
|
||||
echo "Grepping for PR info:"
|
||||
grep "#${PR_NUMBER}\\b.*@${PR_SUBMITTER}\\b" <<< "$ADDED"
|
||||
grep "#${PR_NUMBER}\\b.*[(]@$(quote ${PR_SUBMITTER})[)]" <<< "$ADDED"
|
||||
|
Loading…
Reference in New Issue
Block a user