Skip to content

Commit 12934f8

Browse files
committed
fix: CD properly detect release branch
1 parent ebe361c commit 12934f8

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

.github/workflows/release-pr.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,17 @@ jobs:
1111
github.event.comment.user.login != 'polywrap-build-bot'
1212
runs-on: ubuntu-18.04
1313
steps:
14+
- name: Get Release Branch
15+
run: |
16+
releaseBranch="$(gh api /repos/polywrap/toolchain/pulls/${github.event.issue.number} --jq '.base.ref')"
17+
echo 'RELEASE_BRANCH='$releaseBranch >> $GITHUB_ENV
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
1421
- name: Checkout
15-
uses: actions/checkout@v2
22+
uses: actions/checkout@3.1.0
1623
with:
17-
ref: ${{ github.event.pull_request.head.ref }}
24+
ref: $RELEASE_BRANCH
1825

1926
- name: Commenter Is Publisher?
2027
run: |
@@ -81,10 +88,17 @@ jobs:
8188
needs: Pre-Check
8289
runs-on: ubuntu-18.04
8390
steps:
91+
- name: Get Release Branch
92+
run: |
93+
releaseBranch="$(gh api /repos/polywrap/toolchain/pulls/${github.event.issue.number} --jq '.base.ref')"
94+
echo 'RELEASE_BRANCH='$releaseBranch >> $GITHUB_ENV
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
8498
- name: Checkout
85-
uses: actions/checkout@v2
99+
uses: actions/checkout@3.1.0
86100
with:
87-
ref: ${{ github.event.pull_request.head.ref }}
101+
ref: $RELEASE_BRANCH
88102

89103
- name: Set env.BOT to Build Bot's Username
90104
run: echo BOT=polywrap-build-bot >> $GITHUB_ENV
@@ -143,7 +157,7 @@ jobs:
143157
token: ${{ secrets.POLYWRAP_BUILD_BOT_PAT }}
144158
push-to-fork: ${{env.BOT}}/${{github.event.repository.name}}
145159
branch: release/origin-${{env.RELEASE_VERSION}}
146-
base: ${{ github.event.pull_request.head.ref }}
160+
base: $RELEASE_BRANCH
147161
committer: GitHub <noreply@github.com>
148162
author: ${{env.BOT}} <${{env.BOT}}@users.noreply.github.com>
149163
commit-message: "${{env.RELEASE_VERSION}}"

0 commit comments

Comments
 (0)