Skip to content
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

add badge next to github PR and issues #3205

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more strict regex
  • Loading branch information
mustakimali committed Dec 10, 2021
commit 511a073c4976d56b26a789ffaf19192e9b6f3323
6 changes: 2 additions & 4 deletions generate-book.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ add_badge() {
TITLE=${1:-PR}
TYPE=${2:-pull}
SHIELD_IO_TYPE=${3:-$TYPE}

echo "$TITLE - $TYPE - $SHIELD_IO_TYPE"

FIND="\(https://github.com/(.*)/(.*)/$TYPE/(.*)\)"
SUBS="(https:\/\/github.com\/\1\/\2\/$TYPE\/\3) ![$TITLE \3 badge](https:\/\/shields.io\/github\/$SHIELD_IO_TYPE\/detail\/state\/\1\/\2\/\3)"
FIND="\(https://github.com/([^/]*)/([^/]*)/$TYPE/([^)]*)\)"
SUBS="(https:\/\/github.com\/\1\/\2\/$TYPE\/\3) ![$TITLE #\3 badge](https:\/\/shields.io\/github\/$SHIELD_IO_TYPE\/detail\/state\/\1\/\2\/\3)"

sed -ibak -E "s|$FIND|$SUBS|g" src/*-*.md
}
Expand Down