Skip to content

Commit 56002f4

Browse files
committed
create_ifu_tag: updates from testing on rocm fork
- Need to use upstream/main for rocm/pytorch's develop branch. For release branches, `github.event.pull_request.base.ref` should work as is. - Need to remove any trailing space in PR TITTLE so branch name can be formed correctly Fixes #ISSUE_NUMBER
1 parent 777e73c commit 56002f4

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

.github/workflows/create_ifu_tag.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ jobs:
4040
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
4141
MERGE_SHA="${{ github.event.pull_request.merge_commit_sha }}"
4242
43+
# For release branches, local branch is same as remote branch. But, for rocm/pytorch's
44+
# develop branch, we want to use main branch upstream
45+
if [ "$BASE_REF" == "develop" ]; then
46+
BASE_REF="main"
47+
fi
48+
49+
echo "PR_NUM=$PR_NUM"
50+
echo "BASE_REF=$BASE_REF"
51+
echo "HEAD_SHA=$HEAD_SHA"
52+
echo "MERGE_SHA=$MERGE_SHA"
53+
4354
# The ROCm base commit is the first parent of the merge commit that landed the PR
4455
# (i.e., the base branch tip BEFORE this PR merged).
4556
ROCM_BASE_SHA=$(git rev-parse "${MERGE_SHA}^1")
@@ -52,10 +63,6 @@ jobs:
5263
# between the PR head commit and upstream/main as fetched now.
5364
# This gives you the exact upstream commit (or the best common ancestor) that HEAD included.
5465
UPSTREAM_MAIN_SHA=$(git merge-base "${HEAD_SHA}" "upstream/$BASE_REF")
55-
echo "PR_NUM=$PR_NUM"
56-
echo "BASE_REF=$BASE_REF"
57-
echo "HEAD_SHA=$HEAD_SHA"
58-
echo "MERGE_SHA=$MERGE_SHA"
5966
echo "ROCM_BASE_SHA=$ROCM_BASE_SHA"
6067
echo "UPSTREAM_MAIN_SHA=$UPSTREAM_MAIN_SHA"
6168

@@ -72,7 +79,8 @@ jobs:
7279
run: |
7380
TITLE="${{ github.event.pull_request.title }}"
7481
# Remove everything up to and including "[AUTOGENERATED]"
75-
BASE_TAG=$(echo "$TITLE" | sed -E 's/^\[AUTOGENERATED\][[:space:]]*//')
82+
# Remove trailing whitespace
83+
BASE_TAG=$(echo "$TITLE" | sed -E 's/^\[AUTOGENERATED\][[:space:]]*//' | sed -E 's/[[:space:]]+$//')
7684
7785
echo "BASE_TAG=$BASE_TAG"
7886
echo "PRE_TAG=${BASE_TAG}_pre"

0 commit comments

Comments
 (0)