|
6 | 6 | on: |
7 | 7 | issue_comment: |
8 | 8 | types: [created] |
| 9 | + pull_request: |
9 | 10 | jobs: |
10 | 11 | deploy: |
11 | 12 | runs-on: ubuntu-latest |
12 | 13 | # todo skip already created deploys on that commit |
13 | 14 | if: >- |
14 | | - github.event.issue.pull_request != '' && |
15 | 15 | ( |
16 | | - contains(github.event.comment.body, '/deploy') |
| 16 | + github.event.issue.pull_request != '' && |
| 17 | + ( |
| 18 | + contains(github.event.comment.body, '/deploy') |
| 19 | + ) |
| 20 | + ) || |
| 21 | + ( |
| 22 | + github.event_name == 'pull_request' && ( |
| 23 | + env.AUTO_DEPLOY_PRS contains $'\n' + toString(github.event.pull_request.number) + $'\n' || |
| 24 | + startsWith(env.AUTO_DEPLOY_PRS, toString(github.event.pull_request.number) + $'\n') || |
| 25 | + endsWith(env.AUTO_DEPLOY_PRS, $'\n' + toString(github.event.pull_request.number)) || |
| 26 | + env.AUTO_DEPLOY_PRS == toString(github.event.pull_request.number) |
| 27 | + ) |
17 | 28 | ) |
18 | 29 | permissions: |
19 | 30 | pull-requests: write |
20 | 31 | steps: |
21 | | - - name: Checkout |
| 32 | + - name: Checkout PR (comment) |
22 | 33 | uses: actions/checkout@v2 |
| 34 | + if: github.event_name == 'issue_comment' |
23 | 35 | with: |
24 | 36 | ref: refs/pull/${{ github.event.issue.number }}/head |
| 37 | + - name: Checkout PR (pull_request) |
| 38 | + uses: actions/checkout@v2 |
| 39 | + if: github.event_name == 'pull_request' |
| 40 | + |
25 | 41 | |
26 | 42 | - uses: actions/setup-node@v4 |
27 | 43 | with: |
|
59 | 75 | id: alias |
60 | 76 | env: |
61 | 77 | ALIASES: ${{ env.ALIASES }} |
62 | | - PULL_URL: ${{ github.event.issue.pull_request.url }} |
| 78 | + PULL_URL: ${{ github.event.issue.pull_request.url || github.event.pull_request.url }} |
63 | 79 | - name: Set deployment alias |
64 | 80 | if: ${{ steps.alias.outputs.alias != '' && steps.alias.outputs.alias != 'mcraft.fun' && steps.alias.outputs.alias != 's.mcraft.fun' }} |
65 | 81 | run: vercel alias set ${{ steps.deploy.outputs.stdout }} ${{ steps.alias.outputs.alias }} --token=${{ secrets.VERCEL_TOKEN }} --scope=zaro |
0 commit comments