Skip to content

Commit 7759a16

Browse files
Merge pull request #37397 from MetaMask/release/13.8.0
release: 13.8.0
2 parents a4060a4 + b01dffe commit 7759a16

File tree

957 files changed

+30328
-9929
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

957 files changed

+30328
-9929
lines changed

.github/workflows/fitness-functions.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ jobs:
336336
runs-on: ubuntu-latest
337337
timeout-minutes: 30
338338
env:
339+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
339340
INFURA_PROJECT_ID: ${{ secrets.INFURA_PROJECT_ID }}
340341
GOOGLE_PROD_CLIENT_ID: 00000000000
341342
APPLE_PROD_CLIENT_ID: 00000000000
@@ -345,7 +346,8 @@ jobs:
345346
APPLE_EXPERIMENTAL_CLIENT_ID: 00000000000
346347
GOOGLE_FLASK_CLIENT_ID: 00000000000
347348
APPLE_FLASK_CLIENT_ID: 00000000000
348-
349+
outputs:
350+
lavamoat-policy-changed: ${{ steps.lavamoat-policy-changed.outputs.lavamoat-policy-changed }}
349351
steps:
350352
- name: Checkout and setup environment
351353
uses: MetaMask/action-checkout-and-setup@v1
@@ -354,15 +356,47 @@ jobs:
354356
skip-allow-scripts: true
355357
use-yarn-hydrate: true
356358

359+
- name: Download changed-files artifact
360+
if: ${{ env.BRANCH != 'main' }}
361+
id: download-changed-files
362+
continue-on-error: true
363+
uses: actions/download-artifact@v4
364+
with:
365+
name: changed-files
366+
path: ./changed-files/
367+
368+
# if the changed-files artifact does not exist, we get the diff
369+
- run: yarn tsx .github/scripts/git-diff-default-branch.ts
370+
if: ${{ steps.download-changed-files.outcome == 'failure' }}
371+
372+
- name: See if lavamoat policy files have changed
373+
id: lavamoat-policy-changed
374+
run: |
375+
# if 'changed-files/changed-files.json' exists, check if it contains any files named policy.json or policy-override.json
376+
if [ -f "changed-files/changed-files.json" ]; then
377+
if grep -q -e 'policy.json' -e 'policy-override.json' changed-files/changed-files.json; then
378+
echo "Lavamoat policy file changes detected."
379+
echo "lavamoat-policy-changed=true" >> "$GITHUB_OUTPUT"
380+
else
381+
echo "No Lavamoat policy file changes detected."
382+
echo "lavamoat-policy-changed=false" >> "$GITHUB_OUTPUT"
383+
fi
384+
else
385+
echo "Cannot find 'changed-files.json', assuming that Lavamoat policy files have changed."
386+
echo "lavamoat-policy-changed=true" >> "$GITHUB_OUTPUT"
387+
fi
388+
357389
- name: Download artifact 'build-dist-browserify'
390+
if: ${{ steps.lavamoat-policy-changed.outputs.lavamoat-policy-changed == 'true' }}
358391
uses: actions/download-artifact@v4
359392
with:
360393
name: build-dist-browserify
361394

362395
- run: ./.github/scripts/create-lavamoat-viz.sh
396+
if: ${{ steps.lavamoat-policy-changed.outputs.lavamoat-policy-changed == 'true' }}
363397

364398
- name: Upload 'build-viz' to S3
365-
if: ${{ vars.AWS_REGION && vars.AWS_IAM_ROLE && vars.AWS_S3_BUCKET }}
399+
if: ${{ steps.lavamoat-policy-changed.outputs.lavamoat-policy-changed == 'true' && vars.AWS_REGION && vars.AWS_IAM_ROLE && vars.AWS_S3_BUCKET }}
366400
uses: metamask/github-tools/.github/actions/upload-s3@1233659b3850eb84824d7375e2e0c58eb237701d
367401
with:
368402
aws-region: ${{ vars.AWS_REGION }}
@@ -372,6 +406,7 @@ jobs:
372406

373407
publish-prerelease:
374408
name: Publish prerelease
409+
if: ${{ github.event_name != 'merge_group' }} # Skip this job for the Merge Queue
375410
needs:
376411
- build-dist-browserify
377412
- build-dist-mv2-browserify
@@ -390,6 +425,8 @@ jobs:
390425
- build-source-map-explorer
391426
- build-lavamoat-viz
392427
uses: ./.github/workflows/publish-prerelease.yml
428+
with:
429+
lavamoat-policy-changed: ${{ needs.build-lavamoat-viz.outputs.lavamoat-policy-changed == 'true' }}
393430
secrets:
394431
PR_COMMENT_TOKEN: ${{ secrets.PR_COMMENT_TOKEN }}
395432

.github/workflows/publish-prerelease.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
secrets:
66
PR_COMMENT_TOKEN:
77
required: true
8+
inputs:
9+
lavamoat-policy-changed:
10+
description: 'Whether the Lavamoat policy files have changed'
11+
required: true
12+
type: boolean
813

914
jobs:
1015
publish-prerelease:
@@ -25,6 +30,7 @@ jobs:
2530
MERGE_BASE_COMMIT_HASH: '' # placeholder so that we have autocomplete and logs
2631
CLOUDFRONT_REPO_URL: ${{ vars.AWS_CLOUDFRONT_URL }}/${{ github.event.repository.name }}
2732
HOST_URL: ${{ vars.AWS_CLOUDFRONT_URL }}/${{ github.event.repository.name }}/${{ github.run_id }}
33+
LAVAMOAT_POLICY_CHANGED: ${{ inputs.lavamoat-policy-changed }}
2834
steps:
2935
- name: Checkout and setup high risk environment
3036
uses: MetaMask/action-checkout-and-setup@v1

.github/workflows/repository-health-checks.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
uses: MetaMask/action-checkout-and-setup@v1
1717
with:
1818
is-high-risk-environment: false
19+
fetch-depth: 0 # This is needed to checkout all branches
1920
skip-allow-scripts: true
2021
use-yarn-hydrate: true
2122

@@ -62,3 +63,16 @@ jobs:
6263
echo "::error::Working tree dirty."
6364
exit 1
6465
fi
66+
67+
- name: Run fitness functions
68+
if: ${{ !cancelled() && github.event_name == 'pull_request'}}
69+
env:
70+
BASE_REF: ${{ github.event.pull_request.base.ref }}
71+
run: |
72+
# The following command generates a diff of changes between the common
73+
# ancestor of $BASE_REF and HEAD, and the current commit (HEAD), for
74+
# files in the current directory and its subdirectories. The output is
75+
# then saved to a file called "diff".
76+
git diff "$(git merge-base "origin/$BASE_REF" HEAD)" HEAD -- . > ./diff
77+
78+
yarn fitness-functions ci ./diff

.github/workflows/run-benchmarks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
1515
jobs:
1616
benchmarks:
17+
if: ${{ github.event_name != 'merge_group' }} # Skip this job for the Merge Queue
1718
runs-on: ubuntu-22.04
1819
timeout-minutes: 30
1920
strategy:

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
use-yarn-hydrate: true
7474

7575
- name: test:integration:coverage
76-
run: yarn test:integration:coverage
76+
run: yarn test:integration:coverage --silent
7777

7878
- name: Rename coverage
7979
run: mv coverage/integration/coverage-final.json coverage/integration/coverage-integration.json

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env sh
22
. "$(dirname -- "$0")/_/husky.sh"
33

4-
npm run fitness-functions -- "pre-commit-hook"
4+
yarn fitness-functions pre-commit-hook

0 commit comments

Comments
 (0)