|
1 | 1 | name: Release-PR |
2 | 2 | on: |
3 | | - issue_comment: |
4 | | - types: [created] |
| 3 | + pull_request: |
| 4 | + types: [closed] |
5 | 5 |
|
6 | 6 | jobs: |
7 | 7 | Pre-Check: |
8 | 8 | 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' |
12 | 12 | runs-on: ubuntu-18.04 |
13 | 13 | 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 | | - |
21 | 14 | - name: Checkout |
22 | 15 | uses: actions/checkout@3.1.0 |
23 | 16 | with: |
24 | | - ref: $RELEASE_BRANCH |
| 17 | + ref: ${{github.event.pull_request.base.ref}} |
25 | 18 |
|
26 | 19 | - name: Commenter Is Publisher? |
27 | 20 | run: | |
|
32 | 25 | echo IS_PUBLISHER=false >> $GITHUB_ENV |
33 | 26 | fi |
34 | 27 | env: |
35 | | - COMMENTER: ${{github.event.comment.user.login}} |
| 28 | + COMMENTER: ${{github.pull_request.user.login}} |
36 | 29 |
|
37 | 30 | - name: Commenter Is Not Publisher... |
38 | 31 | if: ${{env.IS_PUBLISHER == 'false'}} |
|
44 | 37 | issue_number: context.issue.number, |
45 | 38 | owner: context.repo.owner, |
46 | 39 | 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...' |
48 | 41 | }) |
49 | 42 |
|
50 | 43 | - name: Read VERSION into env.RELEASE_VERSION |
@@ -88,17 +81,10 @@ jobs: |
88 | 81 | needs: Pre-Check |
89 | 82 | runs-on: ubuntu-18.04 |
90 | 83 | 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 | | - |
98 | 84 | - name: Checkout |
99 | 85 | uses: actions/checkout@3.1.0 |
100 | 86 | with: |
101 | | - ref: $RELEASE_BRANCH |
| 87 | + ref: ${{github.event.pull_request.base.ref}} |
102 | 88 |
|
103 | 89 | - name: Set env.BOT to Build Bot's Username |
104 | 90 | run: echo BOT=polywrap-build-bot >> $GITHUB_ENV |
@@ -155,9 +141,9 @@ jobs: |
155 | 141 | uses: peter-evans/create-pull-request@v3 |
156 | 142 | with: |
157 | 143 | 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}} |
159 | 145 | branch: release/origin-${{env.RELEASE_VERSION}} |
160 | | - base: $RELEASE_BRANCH |
| 146 | + base: ${{github.event.pull_request.base.ref}} |
161 | 147 | committer: GitHub <noreply@github.com> |
162 | 148 | author: ${{env.BOT}} <${{env.BOT}}@users.noreply.github.com> |
163 | 149 | commit-message: "${{env.RELEASE_VERSION}}" |
|
0 commit comments