Skip to content

Commit b29f25b

Browse files
committed
Update pr-title-bot.yml
1 parent 2126dab commit b29f25b

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/pr-title-bot.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ jobs:
114114
exit 0
115115
fi
116116
117-
sub_repo=$(printf '%s' "$submodule_url" | sed -E 's#^https://github\.com/([^/]+/[^/]+?)(\.git)?/?$#\1#')
117+
sub_repo=$(printf '%s' "$submodule_url" | tr -d '\r' | sed -E 's/[[:space:]]+$//' \
118+
| sed -E 's#^https://github\.com/##' | sed -E 's#\.git$##' | sed -E 's#/$##')
118119
119120
common_name=$(gh api "repos/$sub_repo/contents/plugin.json?ref=$submodule_sha" --jq '.content' 2>/dev/null \
120121
| base64 -d 2>/dev/null | jq -r '.common_name // empty' 2>/dev/null || true)
@@ -125,10 +126,10 @@ jobs:
125126
fi
126127
127128
new_title="$verb $common_name"
128-
current_title=$(gh pr view "$PR_NUMBER" --json title --jq '.title')
129+
current_title=$(gh pr view "$PR_NUMBER" --repo "$REPO" --json title --jq '.title')
129130
130131
if [[ "$current_title" != "$new_title" ]]; then
131-
gh pr edit "$PR_NUMBER" --title "$new_title"
132+
gh pr edit "$PR_NUMBER" --repo "$REPO" --title "$new_title"
132133
fi
133134
134-
gh pr edit "$PR_NUMBER" --add-label "$label" --remove-label "$other_label"
135+
gh pr edit "$PR_NUMBER" --repo "$REPO" --add-label "$label" --remove-label "$other_label"

0 commit comments

Comments
 (0)