Skip to content

feat(card): gate Money Account card linkage on allowlisted spending token #178034

feat(card): gate Money Account card linkage on allowlisted spending token

feat(card): gate Money Account card linkage on allowlisted spending token #178034

name: Check template and add labels
on:
issues:
types: [opened, edited, labeled, unlabeled, reopened]
pull_request_target:
# `ready_for_review` / `converted_to_draft` flip the check between
# "informational" (draft) and "blocking" (non-draft) the moment the author
# changes state. `synchronize` keeps the status fresh as new commits land.
types: [opened, edited, labeled, unlabeled, reopened, ready_for_review, converted_to_draft, synchronize]
merge_group:
jobs:
is-fork-pull-request:
name: Determine whether this is a pull request from a fork
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request_target' }}
outputs:
IS_FORK: ${{ steps.is-fork.outputs.IS_FORK }}
steps:
- uses: actions/checkout@v4
- name: Determine whether this PR is from a fork
id: is-fork
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.number }}
check-template-and-add-labels:
runs-on: ubuntu-latest
needs: [is-fork-pull-request]
if: ${{ always() && github.event_name != 'merge_group' && (github.event_name == 'issues' || (github.event_name == 'pull_request_target' && needs.is-fork-pull-request.outputs.IS_FORK == 'false')) }}
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
# WARNING: do NOT add `ref:` here — pull_request_target must stay on the base branch.
uses: actions/checkout@v4
with:
fetch-depth: 1 # This retrieves only the latest commit.
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies with retry
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 #v3.0.2
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 30
command: cd .github/scripts && yarn --immutable
- name: Get access token
id: get-token
uses: MetaMask/github-tools/.github/actions/get-token@v1
with:
token-exchange-url: ${{ vars.TOKEN_EXCHANGE_URL }}
permissions: |
issues: write
members: read
pull_requests: write
- name: Check template and add labels
id: check-template-and-add-labels
env:
LABEL_TOKEN: ${{ steps.get-token.outputs.token }}
run: npm run check-template-and-add-labels
working-directory: '.github/scripts'