|
40 | 40 | HEAD_SHA="${{ github.event.pull_request.head.sha }}" |
41 | 41 | MERGE_SHA="${{ github.event.pull_request.merge_commit_sha }}" |
42 | 42 |
|
| 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 | + |
43 | 54 | # The ROCm base commit is the first parent of the merge commit that landed the PR |
44 | 55 | # (i.e., the base branch tip BEFORE this PR merged). |
45 | 56 | ROCM_BASE_SHA=$(git rev-parse "${MERGE_SHA}^1") |
|
52 | 63 | # between the PR head commit and upstream/main as fetched now. |
53 | 64 | # This gives you the exact upstream commit (or the best common ancestor) that HEAD included. |
54 | 65 | 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" |
59 | 66 | echo "ROCM_BASE_SHA=$ROCM_BASE_SHA" |
60 | 67 | echo "UPSTREAM_MAIN_SHA=$UPSTREAM_MAIN_SHA" |
61 | 68 |
|
|
72 | 79 | run: | |
73 | 80 | TITLE="${{ github.event.pull_request.title }}" |
74 | 81 | # 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:]]+$//') |
76 | 84 |
|
77 | 85 | echo "BASE_TAG=$BASE_TAG" |
78 | 86 | echo "PRE_TAG=${BASE_TAG}_pre" |
|
0 commit comments