-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version v12.1.0 #25586
Merged
Merged
Version v12.1.0 #25586
Changes from all commits
Commits
Show all changes
299 commits
Select commit
Hold shift + click to select a range
c23654d
feat: adding pluggable section to confirmation page (#25061)
jpuri 832ae1c
fix: updates MMI e2e confirm transaction flow (#25053)
zone-live b3c810e
feat(multichain): add new selectors (#25205)
ccharly 2b2ee43
fix: Swap-Send flaky test fix (#25041)
vthomas13 8a04980
chore: upgrading to design tokens v4 (#24953)
georgewrmarshall 4f7f8f0
feat: add popular network list modal (#25160)
salimtb fbd9bbd
fix: add deprecated tag back to callBackgroundMethod (#25216)
DDDDDanica c67aa3f
fix: UX: NetworkList: Consolidate NetworkListItem usages (#25195)
darkwing 9a5aeae
feat: Support various redesign signatures in ConfirmPage Storybook (#…
digiwand 57b9c82
feat: permit signature simulation info (#24862)
jpuri 32af889
fix: Capture Segment errors during initialization (#25253)
Gudahtt 85cf430
feat: permit signature copy changes (#24975)
jpuri 3595052
refactor: app header (#25143)
montelaidev ab695aa
feat: adds "data collection for marketing" toggles (#24605)
jonybur a3cbcef
feat: Integrate SIP-12 update (#23697)
hmalik88 8fabd54
chore: add Non-EVM feature flag (#25241)
gantunesr 9c87c1b
fix: flaky test `Change assets changes to native currency when switch…
seaona 5988cc5
test: add missing mocks for aggregator metadata, block list and inclu…
seaona e0d6c42
chore: updating failing snapshot in develop (#25261)
georgewrmarshall 696cf1d
fix: add metrics ui_customizations: permit for permit signature types…
jpuri dc5247f
fix: Retry requests from provider after connection is ready, on all b…
jiexi 7e24e8f
fix: hide privacy policy toast during onboarding, and for onboarded u…
jonybur e407384
chore(deps): Bump base-controller to ^5.0.1 (#24209)
mcmire d8e0cd1
fix: issue where user rejected request errors are not correctly handl…
adonesky1 dda8d96
fix: swap+send e2e tests (#25275)
dbrans 92e6b94
fix: bump `SelectedNetworkController` to fix issue where selected net…
adonesky1 bb71b24
fix: fix typo in pre-build-mv2 and changed value of ENABLE_CONFIRMATI…
DDDDDanica 59a805a
fix: Simulations on signature pages should be displayed only if prefe…
jpuri 453b2b5
fix: notification dates edge case (#25148)
Prithpal-Sooriya 0dff71e
fix: flaky test `ENS domain resolves to a correct address` (#25248)
seaona 933e09d
fix: flaky test `Send NFT should not be able to send ERC1155 NFT with…
seaona 0fd5f5e
feat: SIWE sign message section (#24997)
jpuri 54823b9
chore: bump keyring-api and eth-snap-keyring (#25287)
montelaidev 1d92608
feat: add search feature (#25170)
salimtb 64c2497
fix: fix token detection modal stuck on firefox (#25279)
sahar-fehri e3071f2
feat: Use sandboxed pages for Snaps execution in MV3 (#25171)
FrederikBolding 82efbdf
refactor: Part of #17670- Replace Typography with Text component in c…
Devin-Apps 6983710
refactor: Replace Typography with Text component in skip-srp-backup-p…
Devin-Apps 04642d2
chore: revert recent gas api endpoint changes (#25230)
dbrans 8141ff2
fix: flaky test `Full-size View Setting @no-mmi opens the extension i…
seaona 42a0bac
fix: flaky test `Custom network JSON-RPC API should show warning when…
seaona 5f78300
refactor: Migrate Typography to Text component in definition-list.js …
Devin-Apps 95b10da
refactor: Part of #17670 - Replace Typography with Text component in …
Devin-Apps 8539477
feat: filter eth requests for non-EVM accounts (#25038)
montelaidev b7d7a34
refactor: use new multichain selectors in accounts related components…
ccharly 0d32814
fix: notification detail network fee broke application (#25315)
Prithpal-Sooriya 191ab10
fix: flaky test `should not prevent network requests to basic functio…
seaona 6163319
fix: Fix switch network popup (#25299)
NidhiKJha 4aa2fd0
fix: flaky test `Navigate transactions should reject and remove all u…
seaona 901289c
fix: filter only EVM address when calling syncWithAddresses (#25313)
montelaidev 62ca8ad
fix: use a min-width value in the notifications-tag-counter (#25322)
matteoscurati 6eee01a
feat: Add team label to pr (#25208)
itsyoboieltr b0a05f0
fix: flaky test `vault decrypt` due to SRP hold time (#25328)
seaona 743f5ec
fix: Ensure phishing stale list network request is not sent before on…
danjm 2aaf565
feat: Convert MetaMetricsController tests from mocha to jest (#25210)
itsyoboieltr 23a303d
fix: Confirmation bridge verify backend (#25047)
ejwessel 8b764fa
fix: re-add patch to nonce-tracker that was incorrectly removed (#25342)
dbrans 624763a
fix: swap+send bugs in Version v12.0.0 release (#25307)
micaelae 4147b2d
fix: upgrade dependency ws (#25372)
legobeat 3820f01
fix: typo in proposed nickname settings (#23562)
coreyjanssen ed06176
fix: display the correct symbol of a native currency (#25364)
matteoscurati 68d35f0
fix: failing push notifications (#25340)
Prithpal-Sooriya e70e44f
chore: Refactor offscreen creation logic (#25302)
FrederikBolding 7e03b4d
fix: logic for using notifications tabs (#25350)
matteoscurati cab9dba
feat: Update the counter over the fox to handle notifications (#25093)
matteoscurati f6890a7
fix(25335): fix flaky test "Unlock wallet should send first three Pag…
DDDDDanica 45c9466
fix: Improve stability of initial state sync in Snaps UI (#25375)
FrederikBolding 7b33133
fix: Fix unit and e2e tests that were expected the date based privacy…
Prithpal-Sooriya 906f7d3
feat: multi RPC editor (#25219)
bergeron 1c8ad63
feat: Network buttons during advanced onboarding (#25276)
bergeron c306f20
test: fix flaky tests that fail due to sentry's `sendClientReports` s…
davidmurdoch 85783b1
feat: add custom network modal form (#25213)
salimtb 40c0f02
fix: hide mark all as read button with no uread notifications (#25348)
matteoscurati da4b61c
test: use tsx for E2E tests instead of ts-node (#25399)
HowardBraham b0f57cf
chore: Bump Snaps packages (#25292)
FrederikBolding 2115516
fix: copy changes in re-designed SIWE signature pages (#25381)
jpuri f5a3437
feat: Convert Swaps test from mocha to jest (#25297)
itsyoboieltr 97b7303
fix: Disable Smart Transactions for the new Send&Swap feature (#25422)
dan437 038f3d6
feat(mmi): start implementing mmi ofa feature (#24749)
albertolive e54295d
feat: fetch nfts on components (#24547)
sahar-fehri a16d1be
fix: Update Beta build configuration (#25430)
Gudahtt 523af49
fix: fix a delay on the account toggles (#25428)
matteoscurati 5472d47
test: [Snaps E2E] Create test for snaps interactive ui functions (#24…
bowensanders aabd481
chore: update channel for contact MMI team and CircleCI step (#25247)
zone-live b279386
feat: add rates controller (#25314)
montelaidev 428052a
feat: update blockaid to version 1.4.8 (#25439)
jpuri e29ed39
chore: update mmi circleCi config PW step (#25440)
zone-live 9e810ee
fix: fix linea ticker (#25436)
salimtb 7e6fb5d
fix: handle long nft ids in simulation amount pill (#25252)
OGPoyraz f26f4bb
fix: fix usd amount in swap notifications (#25444)
matteoscurati 03741c9
feat: split ConfirmPage storybook pages by transaction type (#25283)
digiwand ba8d84e
feat: Bump `queued-request-controller` to `^1.0.0` (#25310)
jiexi b8bd980
chore: remove repetitive words (#23421)
cuithon 2ccf3cf
fix: Don't ignore Yarn patch files (#25398)
mcmire 5ce1822
feat(23946): Add advanced details component (#24833)
pedronfigueiredo 533a483
chore: migrate swaps controller to typescript (#25063)
nikoferro f327c95
feat: percentage increase feature (#24223)
salimtb acdaa2d
feat: Convert Detect multiple instances tests from mocha to jest (#25…
itsyoboieltr 03b7dec
fix: flaky test `vault-decrypt` by removing driver navigate to open a…
seaona 99a1df7
fix: capturing primaryType of typed signature messages in metrics (#2…
jpuri 5c9b126
feat: refactor e2e wallet rendered helper function (#25352)
DDDDDanica 5c8e1a9
fix: Permit signature re-design papercuts (#25383)
jpuri 5960ae7
test: Store artifacts for `test-e2e-chrome-vault-decryption` tests (#…
danjm 3777882
feat: show paymaster address in redesigned contract interaction (#25396)
matthewwalsh0 8e48bee
fix: locked app header styling and connection link (#25326)
montelaidev abbd7ed
feat: Artifact screenshots per open tab (#25453)
vthomas13 a6ebbc7
fix: Preventing a routechange to the Metametrics Onboarding page on w…
vthomas13 7e3b289
feat: edit custom network flow (#25272)
salimtb 48bc2f0
fix: flaky test `vault-decryption` due to autodetect NFT and tokens o…
seaona 97edb9a
fix: filter eth request to non-EVM accounts (#25003)
montelaidev 7c87e58
feat: add alerts for redesigned contract interaction confirmation (#2…
matthewwalsh0 a4dc9d3
feat(multichain): add BalancesController (#25257)
danroc 889ff38
fix: issue where queued request counts were not included in logic to …
adonesky1 3552a39
fix: flaky test `Settings Redirects to ENS domains when user inputs E…
seaona 2e00b43
fix: disable multiple send transactions (#25468)
BZahory c632062
fix: disable unsupported swap+send networks (#25474)
BZahory dbdbaf1
fix: ellipsify long NFT IDs (#25479)
BZahory 6414137
chore: Fix boolean setting for `ENABLE_CONFIRMATION_REDESIGN` on `con…
pedronfigueiredo f6acedb
feat: Convert Metamask controller actions tests from mocha to jest (#…
itsyoboieltr b4b06da
chore: Bump Firefox outdated browser version (#25365)
Gudahtt 230dec7
ci: Adding node-linux-medium executor (#25476)
vthomas13 a445529
chore: replace typography with text component in actionable-message a…
Devin-Apps 64b8db4
fix: fix large amount display (#25464)
salimtb fcb4265
fix: flaky test screenshot for `Increase Token Allowance increases to…
seaona 18ebe12
test: Simplify Jest config and expand coverage (#25013)
Gudahtt aac1975
fix(ci): Restrict test-e2e-firefox-flask & test-e2e-firefox-confirmat…
vthomas13 e1cfecf
fix: #25189 - Display network badge for send flow asset (#25470)
darkwing 096d73f
fix(swaps): fix to round gas values to integer (#25488)
nikoferro f90eed6
fix: 25457 firefox extension not work for trezor connect (#25487)
dawnseeker8 2a0e5b2
test: e2e request queue manually switch network (#25271)
jiexi 3f28e7a
refactor: Replace Typography with Text component in recovery-phrase-c…
Devin-Apps ec5cf7e
chore: move keyring snap permissions file (#25491)
gantunesr 130b9b0
feat: add new `useMultichainSelector` (#25423)
montelaidev c9fb2ab
feat: add api spec test infrastructure (#24132)
shanejonas c2a5d78
chore: Create a story for TokenInput component (#25237)
Devin-Apps 2840657
chore(deps): bump keyring-controller and signature-controller (#25033)
mikesposito 9760248
feat: add a new event to track (#25486)
matteoscurati a6990a2
fix: UX: Remove legacy onboarding text (#25404)
darkwing 52a65bc
fix: hide testnet amounts if user opt out in the settings (#25167)
OGPoyraz 765370f
fix: formatting of deadline in permit signature page (#25321)
jpuri bda7cdd
chore: Remove dead code/config related to Mocha unit tests (#25492)
Gudahtt 215f06c
chore: updates MMI packages to latest versions (#25502)
zone-live 1cc54f6
test: add e2e for scenario where `wallet_switchEthereumChain` call is…
adonesky1 7add8ac
fix: do not use STX for swap+send approval (#25510)
BZahory 2cd5813
perf: use global token list in hook (#25501)
BZahory cc8adbd
feat: bump `@metamask/queued-request controller` to `^2.0.0` to fix c…
jiexi 61bd043
chore(deps): Bump notification-controller to ^5.0.1 (#24430)
mikesposito bcc8dcb
chore(deps): bump accounts controller to 17.0.0 (#25291)
montelaidev 9844d1a
fix: Update help center URLs (#24286)
wtzb c27b640
fix: prioritize smart transaction status confirmation (#25478)
matthewwalsh0 daf1ef2
feat: send correct signature or transaction type in account details o…
pnarayanaswamy dc07c62
chore: Remove Snaps code fencing (#25523)
Mrtenz 4e2596f
fix: multichain account list item (#25437)
montelaidev 7e60c9a
chore: Create a story for UnitInput component (#25225)
Devin-Apps 2a61f59
docs: Manual scenario for 'Show test networks' toggle (#23091)
hjetpoluru 69ec573
fix: Issue 20485 (#25518)
ejwessel edf9957
fix: Show outdated browser warning immediately (#25366)
Gudahtt ff26dc8
fix: pin nodejs version to 20.14 (#25534)
bergeron 6918c52
fix: flaky test ` onboarding @no-mmi doesn't make any network request…
seaona f82a04a
fix: enhance accuracy in determining recipient address for contract i…
vinistevam e0fb582
feat: display loader on re-designed confirmation page while blockaid …
jpuri 721673e
chore: Bump Snaps packages (#25505)
FrederikBolding d403213
chore: remove blockaid code fencing (#25549)
jpuri c5d6593
feat: upgrade assets controllers to version 33 (#25484)
bergeron 09b2392
fix: fix percentage changes when balance is zero (#25550)
salimtb 932c725
feat: `externally_connectable` CAIP delivery and enveloping (#25075)
jiexi d91bb02
fix: fix network delete trash displayed on mouse over (#25547)
salimtb a32cbb8
fix: `Cannot destructure property 'balance' of 'K[Z]' as it is undefi…
digiwand a166147
feat(ramps): introduces dynamic support for rampable networks (#24041)
georgeweiler 66bf2f1
feat: Add domain binding SIWE redesign alert row (#25281)
digiwand e01083d
refactor: Confirm Alert Modal - no logic changes (#25371)
digiwand 1d33d6f
fix: flaky test `Swap-Send ETH to non-contract address with data that…
seaona 574f819
chore: update `chokidar` to `v3.6.0` (#25571)
davidmurdoch b37e39d
feat: account overview for bip122:* account types (#25200)
ccharly fde960a
fix: parse tx logs on contractInteraction to refresh NFT state (#25380)
sahar-fehri 3cde035
test: Fix flaky test: "Custom network customNetwork should add mainn…
chloeYue 1661b21
ci: add SonarCloud scan job (#25421)
jvbriones fdc898e
test: UX: Multichain: Add test for mutiple dapp confirmation order (#…
darkwing 1f74b08
feat: adding / deleting additional RPC URLs (#25452)
bergeron 652591f
v12.1.0
chloeYue 43cede8
fix: version v12.1.0 cherry pick 90d89 (#25701)
salimtb 811aa05
cherry-pick: fix decimal places displayed on token value on permit pa…
jpuri ce982e3
cherry-pick: feat improvement for how we display big and small number…
jpuri 50f347c
fix: (cherry-pick)(Version v12.1.0) Error: new BigNumber() more than …
digiwand a87217d
feat: (cherry-pick)(Version v12.1.0) update Permit Signature Redesign…
digiwand 9f0c42a
Cherry-pick d721e7f (PR #25500) to V12.1.0 (#25872)
gantunesr c2f65c4
chore: v12.1.0 cherry pick 56c9dc (#25677)
zone-live b888411
fix: remove showing nft autodetection modal (#25993)
sahar-fehri 656679e
fix: update token detection modal css (#26025)
sahar-fehri b32ee27
Merge branch 'master' into Version-v12.1.0
danjm 3277dad
Update LavaMoat policies
metamaskbot 89e82ad
fix (cherry-pick): Fix page width for fullscreen mode send page (#25771)
darkwing 3711c8f
fix: blockaid report url in redesigned pages (#25702)
jpuri f6d4d17
temp
danjm 2b5c0f5
fix merge errors
danjm a2dbb74
Merge pull request #26283 from MetaMask/merge-master-v12.1.0
danjm 188dece
fix: Cherrypick f3383ac to Version v12.1 (#26285)
montelaidev e19f44a
refactor(notifications): use contentful package as dev dependency (#2…
Prithpal-Sooriya 8e7f71b
Cherry pick 5ee57a63c0 (#25686) to v12.1.0 (#26473)
danjm a19c80f
fix: Fix lint changelog 12.1.0 (#26474)
benjisclowder 46b47d6
fix(deps): bump fast-xml-parser from 4.3.4 to 4.4.1. (#26202)
bergeron db5efc0
Merge pull request #26475 from MetaMask/cherry-pick-cad49eb-v12.1.0
danjm b2a493b
fix (cherry-pick): Enable Save button on Add Contact page for address…
darkwing 2870f59
fix: fallback conversion rate for token market data #4615 (#26460)
bergeron db10925
fix: refactor: cherry-pick 12.1.0 Permit decimal fix + introduce Conf…
digiwand 21e019a
fix: [cherry-pick][V12.1.0] fix loss of precision for very big values…
digiwand 71db1eb
Version v12.1.0 cherrypick 43b8031 (#26158)
montelaidev 0072384
cherry-pick: Update @blockaid/ppom_release to release 1.5.2 (#26499)
jpuri 621d39c
feat: [cherry-pick][V12.1.0] Permit ellipsis fix (2/3) - show ellipsi…
digiwand f0bd13f
Merge tag 'v12.0.0' into Version-v12.1.0
danjm 32edb6d
fix:[cherry-pick][V12.1.0] Permit ellipsis fixes (3/4) - add ellipsis…
digiwand 071c491
fix: [cherry-pick][V12.1.0] Permit ellipsis fixes (4/4) - Permit elli…
digiwand f6d1546
Merge tag 'v12.0.1' into v12.1.0-merge-v12.0.1
danjm 74b0810
Merge tag 'v12.0.2' into v12.1.0-merge-v12.0.2
danjm 381f163
Merge tag 'v12.0.4' into v12.1.0-merge-v12.0.4
danjm 53da406
Merge tag 'v12.0.5' into v12.1.0-merge-v12.0.5
danjm 5d3abbc
fix: [cherry-pick][V12.1.0] permit simulation design - fix style ali…
digiwand 2677cb4
Merge remote-tracking branch 'origin/Version-v12.1.0' into v12.1.0-up…
danjm e6d7a57
chore: Patch security issue in snaps-utils (#25827)
Mrtenz 141a07d
fix: use a counter to show if there are pending transactions (#26116)…
matteoscurati 48fbcd5
Remove assets controller patch added in 12.0.5, which is already incl…
danjm 5a1d0b9
Add missing locale
danjm a5a7f0e
fix (cherry-pick for v12.1.0): reduce spacing in asset picker (#26479)
BZahory b82d102
fix: set network client id for domain (#25646) (#26543)
salimtb 024669b
Merge remote-tracking branch 'origin/Version-v12.1.0' into v12.1.0-up…
danjm 20880e1
Update snapshot tests
danjm 911c5c0
Fix changelog
danjm ee890f9
put back 3e7448c4cd patch
bergeron d8634a6
Cherry-pick 6ed72f0 (PR #26542) (#26557)
gantunesr 8b0d1c3
fix: missing deadline in swaps stx status screen (#25779) (#26544)
martahj 23db62d
fix: track `swapAndSend` transaction type (#26535) (#26594)
BZahory 019829d
Merge branch 'Version-v12.1.0' into v12.1.0-updated
Gudahtt 95af466
Remove unnecessary duplicate version of snaps-utils
Gudahtt bfe7d3f
Update LavaMoat policies
metamaskbot a1d7e13
V12.1.0 changelog (#25745)
benjisclowder eacc314
Merge remote-tracking branch 'origin/master' into v12.1.0-updated-again
Gudahtt b8959dd
Merge branch 'Version-v12.1.0' into v12.1.0-updated
Gudahtt 23651ad
Merge pull request #26519 from MetaMask/v12.1.0-updated
Gudahtt c557a34
Merge remote-tracking branch 'origin/Version-v12.1.0' into v12.1.0-up…
Gudahtt ff16dad
Fix conflicts in changelog
Gudahtt b7db14f
Merge pull request #26607 from MetaMask/v12.1.0-updated-again
Gudahtt 4d299d8
fix: correct duplicate notifications event tracking in global menu (#…
matteoscurati b0d1067
chore: upgrade to Sentry 8 (#25999) [cherry-pick] (#26618)
Gudahtt 04c5fc6
fix: sentry sessions (#26192) [cherry-pick] (#26620)
Gudahtt 6927746
fix (cherry-pick for v12.1.0): add user IDs for send page events (#26…
BZahory 42555d3
refactor: add performance tracing infrastructure (#26044) [cherry-pic…
Gudahtt 5bdc48e
Fix merge conflict resolution error in request-queuing/ui.spec.js, fo…
danjm e5f4f32
Version v12.1.0-beta.0 (#26631)
Gudahtt 335c9e4
chore: Remove non-applicable change entries (#26663)
Gudahtt 7848f3c
chore: Stabilize v12.1.0 (#26664)
Gudahtt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
import * as core from '@actions/core'; | ||
import { context, getOctokit } from '@actions/github'; | ||
import { GitHub } from '@actions/github/lib/utils'; | ||
|
||
import { retrieveLabel } from './shared/label'; | ||
import { Labelable, addLabelByIdToLabelable } from './shared/labelable'; | ||
import { retrievePullRequest } from './shared/pull-request'; | ||
|
||
main().catch((error: Error): void => { | ||
console.error(error); | ||
process.exit(1); | ||
}); | ||
|
||
async function main(): Promise<void> { | ||
// "GITHUB_TOKEN" is an automatically generated, repository-specific access token provided by GitHub Actions. | ||
// We can't use "GITHUB_TOKEN" here, as its permissions are scoped to the repository where the action is running. | ||
// "GITHUB_TOKEN" does not have access to other repositories, even when they belong to the same organization. | ||
// As we want to get files which are not necessarily located in the same repository, | ||
// we need to create our own "RELEASE_LABEL_TOKEN" with "repo" permissions. | ||
// Such a token allows to access other repositories of the MetaMask organisation. | ||
const personalAccessToken = process.env.RELEASE_LABEL_TOKEN; | ||
if (!personalAccessToken) { | ||
core.setFailed('RELEASE_LABEL_TOKEN not found'); | ||
process.exit(1); | ||
} | ||
|
||
// Initialise octokit, required to call Github GraphQL API | ||
const octokit: InstanceType<typeof GitHub> = getOctokit(personalAccessToken, { | ||
previews: ['bane'], // The "bane" preview is required for adding, updating, creating and deleting labels. | ||
}); | ||
|
||
// Retrieve pull request info from context | ||
const pullRequestRepoOwner = context.repo.owner; | ||
const pullRequestRepoName = context.repo.repo; | ||
const pullRequestNumber = context.payload.pull_request?.number; | ||
if (!pullRequestNumber) { | ||
core.setFailed('Pull request number not found'); | ||
process.exit(1); | ||
} | ||
|
||
// Retrieve pull request | ||
const pullRequest: Labelable = await retrievePullRequest( | ||
octokit, | ||
pullRequestRepoOwner, | ||
pullRequestRepoName, | ||
pullRequestNumber, | ||
); | ||
|
||
// Get the team label id based on the author of the pull request | ||
const teamLabelId = await getTeamLabelIdByAuthor( | ||
octokit, | ||
pullRequestRepoOwner, | ||
pullRequestRepoName, | ||
pullRequest.author, | ||
); | ||
|
||
// Add the team label by id to the pull request | ||
await addLabelByIdToLabelable(octokit, pullRequest, teamLabelId); | ||
} | ||
|
||
// This helper function gets the team label id based on the author of the pull request | ||
const getTeamLabelIdByAuthor = async ( | ||
octokit: InstanceType<typeof GitHub>, | ||
repoOwner: string, | ||
repoName: string, | ||
author: string, | ||
): Promise<string> => { | ||
// Retrieve the teams.json file from the repository | ||
const { data } = (await octokit.request( | ||
'GET /repos/{owner}/{repo}/contents/{path}', | ||
{ owner: repoOwner, repo: 'MetaMask-planning', path: 'teams.json' }, | ||
)) as { data: { content: string } }; | ||
|
||
// Parse the teams.json file content to json from base64 | ||
const teamMembers: Record<string, string> = JSON.parse(atob(data.content)); | ||
|
||
// Get the label name based on the author | ||
const labelName = teamMembers[author]; | ||
|
||
if (!labelName) { | ||
core.setFailed(`Team label not found for author: ${author}`); | ||
process.exit(1); | ||
} | ||
|
||
// Retrieve the label id based on the label name | ||
const labelId = await retrieveLabel(octokit, repoOwner, repoName, labelName); | ||
|
||
return labelId; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Add team label to PR when it is opened | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
|
||
jobs: | ||
add-team-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
|
||
- run: corepack enable | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # This is needed to checkout all branches | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn --immutable | ||
|
||
- name: Add team label to PR | ||
id: add-team-label-to-pr | ||
env: | ||
RELEASE_LABEL_TOKEN: ${{ secrets.RELEASE_LABEL_TOKEN }} | ||
run: yarn run add-team-label-to-pr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
name: Sonar | ||
on: | ||
workflow_call: | ||
secrets: | ||
SONAR_TOKEN: | ||
required: true | ||
# pull_request: | ||
# branches: | ||
# - develop | ||
# types: | ||
# - opened | ||
# - reopened | ||
# - synchronize | ||
# - labeled | ||
# - unlabeled | ||
push: | ||
branches: | ||
- develop | ||
pull_request: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
sonarcloud: | ||
|
@@ -25,8 +18,5 @@ jobs: | |
- name: SonarCloud Scan | ||
# This is SonarSource/[email protected] | ||
uses: SonarSource/sonarcloud-github-action@4b4d7634dab97dcee0b75763a54a6dc92a9e6bc1 | ||
with: | ||
args: > | ||
-Dsonar.javascript.lcov.reportPaths=tests/coverage/lcov.info | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: Consider adding error handling for the fetch request.