Skip to content

Commit ee6ace6

Browse files
authored
fix: prod release workflow, reading props of undefined (#1527)
1 parent 76486a9 commit ee6ace6

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

.github/workflows/main_branch.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ jobs:
6161
- name: Release
6262
env:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64-
RELEASE_BRANCH: main
64+
RELEASE_TYPE: alpha
6565
run: yarn run semantic-release

.releaserc.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
This file contains the configuration for semantic release, the library we use to tag the correct
33
semantic version numbers onto releases. We have two release paths, one on main and one on release branch.
44
5-
In the code below we check the env variable RELEASE_BRANCH to decide what we should do. As of
5+
In the code below we check the env variable RELEASE_TYPE to decide what we should do. As of
66
the time of this file semantic release does not support specifying a config file from their CLI,
77
so this is the only we can have dynamic configs based on branch.
88
99
To test run this file, first get a github token at https://github.com/settings/tokens
10-
and add it to the GITHUB_TOKEN env variable then specify what branch you want to run (main or release) under RELEASE_BRANCH
10+
and add it to the GITHUB_TOKEN env variable then specify what kind of release ou want to run (production or alpha) under RELEASE_TYPE
1111
1212
$ export GITHUB_TOKEN=<token>
13-
$ export RELEASE_BRANCH=<main or release>
13+
$ export RELEASE_TYPE=<production or alpha>
1414
$ run yarn run semantic-release -d
1515
1616
@@ -100,7 +100,7 @@ const execSentryReleaseSetting = [
100100
];
101101

102102
let plugins;
103-
if (process.env && process.env.RELEASE_BRANCH === 'release') {
103+
if (process.env && process.env.RELEASE_TYPE === 'production') {
104104
plugins = [
105105
commitAnalyzerSetting,
106106
execSentryReleaseSetting,
@@ -120,10 +120,7 @@ if (process.env && process.env.RELEASE_BRANCH === 'release') {
120120

121121
module.exports = {
122122
// define a main version release branch even though we are doing all releases from main
123-
// this branch list gets overwritten in the production release Github Action
124-
branches: [
125-
'release',
126-
{ name: 'main', prerelease: 'alpha'}
127-
],
123+
// this branch list gets overwritten in the production release Github Action
124+
branches: ['release', { name: 'main', prerelease: 'alpha' }],
128125
plugins,
129126
};

src/background/services/network/events/networksUpdatedEventListener.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Network, NetworkEvents } from '../models';
44
export function networksUpdatedEventListener(
55
evt: ExtensionConnectionEvent<{
66
networks: Network[];
7-
activeNetwork: Network;
7+
activeNetwork?: Network;
88
favoriteNetworks: number[];
99
customNetworks: Record<number, Network>;
1010
}>

src/contexts/NetworkProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export function NetworkContextProvider({ children }: { children: any }) {
193193
setNetworks(result.networks);
194194
setNetwork((currentNetwork) => {
195195
const newNetwork = result.activeNetwork ?? currentNetwork; // do not delete currently set network
196-
networkChanged.dispatch(newNetwork.caipId);
196+
networkChanged.dispatch(newNetwork?.caipId);
197197

198198
return newNetwork;
199199
});

0 commit comments

Comments
 (0)