|
13 | 13 | type: boolean |
14 | 14 | required: false |
15 | 15 | default: false |
| 16 | + pull-request: |
| 17 | + type: number |
| 18 | + required: false |
| 19 | + default: 0 |
16 | 20 |
|
17 | 21 | jobs: |
18 | 22 | is-fork-pull-request: |
19 | 23 | name: Determine whether this issue comment was on a pull request from a fork |
20 | | - if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '@metamaskbot update-pr') || inputs.dependabot == true }} |
| 24 | + if: ${{ inputs.dependabot == true || (github.event.issue.pull_request && startsWith(github.event.comment.body, '@metamaskbot update-pr')) }} |
21 | 25 | runs-on: ubuntu-latest |
22 | 26 | outputs: |
23 | 27 | IS_FORK: ${{ steps.is-fork.outputs.IS_FORK }} |
|
28 | 32 | run: echo "IS_FORK=$(gh pr view --json isCrossRepository --jq '.isCrossRepository' "${PR_NUMBER}" )" >> "$GITHUB_OUTPUT" |
29 | 33 | env: |
30 | 34 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
31 | | - PR_NUMBER: ${{ github.event.issue.number }} |
| 35 | + PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }} |
32 | 36 |
|
33 | 37 | react-to-comment: |
34 | 38 | name: React to the comment |
|
69 | 73 | run: gh pr checkout "${PR_NUMBER}" |
70 | 74 | env: |
71 | 75 | GITHUB_TOKEN: ${{ secrets.PULL_REQUEST_UPDATE_TOKEN }} |
72 | | - PR_NUMBER: ${{ github.event.issue.number }} |
| 76 | + PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }} |
73 | 77 | - name: Use Node.js |
74 | 78 | uses: actions/setup-node@v4 |
75 | 79 | with: |
|
92 | 96 | run: gh pr checkout "${PR_NUMBER}" |
93 | 97 | env: |
94 | 98 | GITHUB_TOKEN: ${{ secrets.PULL_REQUEST_UPDATE_TOKEN }} |
95 | | - PR_NUMBER: ${{ github.event.issue.number }} |
| 99 | + PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }} |
96 | 100 | - name: Setup Node.js |
97 | 101 | uses: actions/setup-node@v4 |
98 | 102 | with: |
@@ -121,7 +125,7 @@ jobs: |
121 | 125 | run: gh pr checkout "${PR_NUMBER}" |
122 | 126 | env: |
123 | 127 | GITHUB_TOKEN: ${{ secrets.PULL_REQUEST_UPDATE_TOKEN }} |
124 | | - PR_NUMBER: ${{ github.event.issue.number }} |
| 128 | + PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }} |
125 | 129 | - name: Restore yarn.lock |
126 | 130 | uses: actions/cache/restore@v4 |
127 | 131 | with: |
@@ -156,7 +160,7 @@ jobs: |
156 | 160 | run: gh pr checkout "${PR_NUMBER}" |
157 | 161 | env: |
158 | 162 | GITHUB_TOKEN: ${{ secrets.PULL_REQUEST_UPDATE_TOKEN }} |
159 | | - PR_NUMBER: ${{ github.event.issue.number }} |
| 163 | + PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }} |
160 | 164 | - name: Restore yarn.lock |
161 | 165 | uses: actions/cache/restore@v4 |
162 | 166 | with: |
@@ -200,7 +204,7 @@ jobs: |
200 | 204 | run: gh pr checkout "${PR_NUMBER}" |
201 | 205 | env: |
202 | 206 | GITHUB_TOKEN: ${{ secrets.PULL_REQUEST_UPDATE_TOKEN }} |
203 | | - PR_NUMBER: ${{ github.event.issue.number }} |
| 207 | + PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }} |
204 | 208 | - name: Configure Git |
205 | 209 | run: | |
206 | 210 | git config --global user.name 'MetaMask Bot' |
|
0 commit comments