Skip to content

Commit 343af32

Browse files
authored
Merge pull request #1388 from polywrap/origin-0.9-dev
Prep 0.9.4 /workflows/release-pr
2 parents 6ec20fe + 51c7f0f commit 343af32

1 file changed

Lines changed: 11 additions & 25 deletions

File tree

.github/workflows/release-pr.yaml

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
name: Release-PR
22
on:
3-
issue_comment:
4-
types: [created]
3+
pull_request:
4+
types: [closed]
55

66
jobs:
77
Pre-Check:
88
if: |
9-
github.event.issue.pull_request &&
10-
startsWith(github.event.comment.body, '/workflows/release-pr') &&
11-
github.event.comment.user.login != 'polywrap-build-bot'
9+
github.event.pull_request.merged &&
10+
endsWith(github.event.pull_request.title, '/workflows/release-pr') &&
11+
github.event.pull_request.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-
2114
- name: Checkout
2215
uses: actions/checkout@3.1.0
2316
with:
24-
ref: $RELEASE_BRANCH
17+
ref: ${{github.event.pull_request.base.ref}}
2518

2619
- name: Commenter Is Publisher?
2720
run: |
@@ -32,7 +25,7 @@ jobs:
3225
echo IS_PUBLISHER=false >> $GITHUB_ENV
3326
fi
3427
env:
35-
COMMENTER: ${{github.event.comment.user.login}}
28+
COMMENTER: ${{github.pull_request.user.login}}
3629

3730
- name: Commenter Is Not Publisher...
3831
if: ${{env.IS_PUBLISHER == 'false'}}
@@ -44,7 +37,7 @@ jobs:
4437
issue_number: context.issue.number,
4538
owner: context.repo.owner,
4639
repo: context.repo.repo,
47-
body: '${{github.event.comment.user.login}} is not a PUBLISHER. Please see the .github/PUBLISHERS file...'
40+
body: '${{github.event.pull_request.user.login}} is not a PUBLISHER. Please see the .github/PUBLISHERS file...'
4841
})
4942
5043
- name: Read VERSION into env.RELEASE_VERSION
@@ -88,17 +81,10 @@ jobs:
8881
needs: Pre-Check
8982
runs-on: ubuntu-18.04
9083
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-
9884
- name: Checkout
9985
uses: actions/checkout@3.1.0
10086
with:
101-
ref: $RELEASE_BRANCH
87+
ref: ${{github.event.pull_request.base.ref}}
10288

10389
- name: Set env.BOT to Build Bot's Username
10490
run: echo BOT=polywrap-build-bot >> $GITHUB_ENV
@@ -155,9 +141,9 @@ jobs:
155141
uses: peter-evans/create-pull-request@v3
156142
with:
157143
token: ${{ secrets.POLYWRAP_BUILD_BOT_PAT }}
158-
push-to-fork: ${{env.BOT}}/${{github.event.repository.name}}
144+
push-to-fork: ${{env.BOT}}/${{github.event.pull_request.base.repo.name}}
159145
branch: release/origin-${{env.RELEASE_VERSION}}
160-
base: $RELEASE_BRANCH
146+
base: ${{github.event.pull_request.base.ref}}
161147
committer: GitHub <noreply@github.com>
162148
author: ${{env.BOT}} <${{env.BOT}}@users.noreply.github.com>
163149
commit-message: "${{env.RELEASE_VERSION}}"

0 commit comments

Comments
 (0)