Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
uses: ./.github/workflows/update-pull-request.yml
with:
dependabot: true
pull-request: ${{ github.event.pull_request.number }}
secrets:
PULL_REQUEST_UPDATE_TOKEN: ${{ secrets.PULL_REQUEST_UPDATE_TOKEN }}

Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/update-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ on:
type: boolean
required: false
default: false
pull-request:
type: number
required: false
default: 0

jobs:
is-fork-pull-request:
name: Determine whether this issue comment was on a pull request from a fork
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '@metamaskbot update-pr') || inputs.dependabot == true }}
if: ${{ inputs.dependabot == true || (github.event.issue.pull_request && startsWith(github.event.comment.body, '@metamaskbot update-pr')) }}
runs-on: ubuntu-latest
outputs:
IS_FORK: ${{ steps.is-fork.outputs.IS_FORK }}
Expand All @@ -28,7 +32,7 @@ jobs:
run: echo "IS_FORK=$(gh pr view --json isCrossRepository --jq '.isCrossRepository' "${PR_NUMBER}" )" >> "$GITHUB_OUTPUT"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }}

react-to-comment:
name: React to the comment
Expand Down Expand Up @@ -69,7 +73,7 @@ jobs:
run: gh pr checkout "${PR_NUMBER}"
env:
GITHUB_TOKEN: ${{ secrets.PULL_REQUEST_UPDATE_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -92,7 +96,7 @@ jobs:
run: gh pr checkout "${PR_NUMBER}"
env:
GITHUB_TOKEN: ${{ secrets.PULL_REQUEST_UPDATE_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -121,7 +125,7 @@ jobs:
run: gh pr checkout "${PR_NUMBER}"
env:
GITHUB_TOKEN: ${{ secrets.PULL_REQUEST_UPDATE_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }}
- name: Restore yarn.lock
uses: actions/cache/restore@v4
with:
Expand Down Expand Up @@ -156,7 +160,7 @@ jobs:
run: gh pr checkout "${PR_NUMBER}"
env:
GITHUB_TOKEN: ${{ secrets.PULL_REQUEST_UPDATE_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }}
- name: Restore yarn.lock
uses: actions/cache/restore@v4
with:
Expand Down Expand Up @@ -200,7 +204,7 @@ jobs:
run: gh pr checkout "${PR_NUMBER}"
env:
GITHUB_TOKEN: ${{ secrets.PULL_REQUEST_UPDATE_TOKEN }}
PR_NUMBER: ${{ github.event.issue.number }}
PR_NUMBER: ${{ inputs.pull-request != 0 && inputs.pull-request || github.event.issue.number }}
- name: Configure Git
run: |
git config --global user.name 'MetaMask Bot'
Expand Down
Loading