Skip to content

Commit

Permalink
feat(publish-to-monorepo): reference stuff ep. 2(#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
SIMULATAN committed Nov 23, 2024
1 parent 20c8c91 commit 96c9416
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
message="${{ github.event.head_commit.message }}"
# use regex to replace ` #xx` with ` repo#xx`
message="$(echo "$message" | sed -r 's/ #([[:digit:]]+)/ '"$REPO_NAME"'#\1/')"
message="$(echo "$message" | perl -pi -e 's/(?<=\W)(#|GH-)(\d+)(?=\W|$)/'"$REPO_NAME"'#$2/gm')"
git commit -m "[$REPO_NAME] $message" -m "Mirrored from ${{ github.event.head_commit.url }}"
Expand Down
13 changes: 13 additions & 0 deletions tests/publish-to-monorepo/test-sed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

input=$(cat <<-EOF
Do something (my/repo#30)
Do smth else (#30, #30)
This matches #30
This wont have to be replaced be/cause#30
This will not m#30tch
Will this match? #30 #40 #50
EOF
)

echo "$input" | perl -pi -e 's/(?<=\W)(#|GH-)(\d+)(?=\W|$)/propromo#$2/gm'

0 comments on commit 96c9416

Please sign in to comment.