Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f56f00

Browse files
authored
chore: addwhich-release script (#18657)
1 parent695de6e commit0f56f00

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

‎scripts/which-release.sh‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
# shellcheck source=scripts/lib.sh
6+
source"$(dirname"${BASH_SOURCE[0]}")/lib.sh"
7+
8+
COMMIT=$1
9+
if [[-z"${COMMIT}" ]];then
10+
log"Usage:$0 <commit-ref>"
11+
log""
12+
log -n"Example:$0"
13+
log$'$(gh pr view <pr-num> --json mergeCommit | jq\'.mergeCommit.oid\' -r)'
14+
exit 2
15+
fi
16+
17+
REMOTE=$(git remote -v| grep coder/coder| awk'{print $1}'| head -n1)
18+
if [[-z"${REMOTE}" ]];then
19+
error"Could not find remote for coder/coder"
20+
fi
21+
22+
log"It is recommended that you run\`git fetch -ap${REMOTE}\` to ensure you get a correct result."
23+
24+
RELEASES=$(git branch -r --contains"${COMMIT}"| grep"${REMOTE}"| grep"/release/"| sed"s|${REMOTE}/||"|| true)
25+
if [[-z"${RELEASES}" ]];then
26+
log"Commit was not found in any release branch"
27+
else
28+
log"Commit was found in the following release branches:"
29+
log"${RELEASES}"
30+
fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp