Skip to content

Commit 31f72ac

Browse files
authored
Merge pull request Expensify#73595 from margelo/@chrispader/github-scripts-constants-refactor
[No QA] refactor: Extract constants into CONST from GitHub scripts
2 parents da1f93e + 6f1b08d commit 31f72ac

21 files changed

Lines changed: 43 additions & 22 deletions

File tree

.github/actions/javascript/authorChecklist/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15544,6 +15544,7 @@ const GIT_CONST = {
1554415544
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
1554515545
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
1554615546
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
15547+
DEFAULT_BASE_REF: 'main',
1554715548
};
1554815549
const CONST = {
1554915550
...GIT_CONST,
@@ -16127,7 +16128,7 @@ class GithubUtils {
1612716128
/**
1612816129
* Get the contents of a file from the API at a given ref as a string.
1612916130
*/
16130-
static async getFileContents(path, ref = 'main') {
16131+
static async getFileContents(path, ref = CONST_1.default.DEFAULT_BASE_REF) {
1613116132
const { data } = await this.octokit.repos.getContent({
1613216133
owner: CONST_1.default.GITHUB_OWNER,
1613316134
repo: CONST_1.default.APP_REPO,

.github/actions/javascript/awaitStagingDeploys/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12348,6 +12348,7 @@ const GIT_CONST = {
1234812348
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
1234912349
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
1235012350
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
12351+
DEFAULT_BASE_REF: 'main',
1235112352
};
1235212353
const CONST = {
1235312354
...GIT_CONST,
@@ -12931,7 +12932,7 @@ class GithubUtils {
1293112932
/**
1293212933
* Get the contents of a file from the API at a given ref as a string.
1293312934
*/
12934-
static async getFileContents(path, ref = 'main') {
12935+
static async getFileContents(path, ref = CONST_1.default.DEFAULT_BASE_REF) {
1293512936
const { data } = await this.octokit.repos.getContent({
1293612937
owner: CONST_1.default.GITHUB_OWNER,
1293712938
repo: CONST_1.default.APP_REPO,

.github/actions/javascript/checkAndroidStatus/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737091,6 +737091,7 @@ const GIT_CONST = {
737091737091
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
737092737092
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
737093737093
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
737094+
DEFAULT_BASE_REF: 'main',
737094737095
};
737095737096
const CONST = {
737096737097
...GIT_CONST,
@@ -737674,7 +737675,7 @@ class GithubUtils {
737674737675
/**
737675737676
* Get the contents of a file from the API at a given ref as a string.
737676737677
*/
737677-
static async getFileContents(path, ref = 'main') {
737678+
static async getFileContents(path, ref = CONST_1.default.DEFAULT_BASE_REF) {
737678737679
const { data } = await this.octokit.repos.getContent({
737679737680
owner: CONST_1.default.GITHUB_OWNER,
737680737681
repo: CONST_1.default.APP_REPO,

.github/actions/javascript/checkDeployBlockers/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11615,6 +11615,7 @@ const GIT_CONST = {
1161511615
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
1161611616
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
1161711617
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
11618+
DEFAULT_BASE_REF: 'main',
1161811619
};
1161911620
const CONST = {
1162011621
...GIT_CONST,
@@ -12198,7 +12199,7 @@ class GithubUtils {
1219812199
/**
1219912200
* Get the contents of a file from the API at a given ref as a string.
1220012201
*/
12201-
static async getFileContents(path, ref = 'main') {
12202+
static async getFileContents(path, ref = CONST_1.default.DEFAULT_BASE_REF) {
1220212203
const { data } = await this.octokit.repos.getContent({
1220312204
owner: CONST_1.default.GITHUB_OWNER,
1220412205
repo: CONST_1.default.APP_REPO,

.github/actions/javascript/checkSVGCompression/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20140,6 +20140,7 @@ const GIT_CONST = {
2014020140
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
2014120141
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
2014220142
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
20143+
DEFAULT_BASE_REF: 'main',
2014320144
};
2014420145
const CONST = {
2014520146
...GIT_CONST,
@@ -20723,7 +20724,7 @@ class GithubUtils {
2072320724
/**
2072420725
* Get the contents of a file from the API at a given ref as a string.
2072520726
*/
20726-
static async getFileContents(path, ref = 'main') {
20727+
static async getFileContents(path, ref = CONST_1.default.DEFAULT_BASE_REF) {
2072720728
const { data } = await this.octokit.repos.getContent({
2072820729
owner: CONST_1.default.GITHUB_OWNER,
2072920730
repo: CONST_1.default.APP_REPO,

.github/actions/javascript/createOrUpdateStagingDeploy/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11743,6 +11743,7 @@ const GIT_CONST = {
1174311743
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
1174411744
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
1174511745
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
11746+
DEFAULT_BASE_REF: 'main',
1174611747
};
1174711748
const CONST = {
1174811749
...GIT_CONST,
@@ -12485,7 +12486,7 @@ class GithubUtils {
1248512486
/**
1248612487
* Get the contents of a file from the API at a given ref as a string.
1248712488
*/
12488-
static async getFileContents(path, ref = 'main') {
12489+
static async getFileContents(path, ref = CONST_1.default.DEFAULT_BASE_REF) {
1248912490
const { data } = await this.octokit.repos.getContent({
1249012491
owner: CONST_1.default.GITHUB_OWNER,
1249112492
repo: CONST_1.default.APP_REPO,

.github/actions/javascript/getArtifactInfo/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11576,6 +11576,7 @@ const GIT_CONST = {
1157611576
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
1157711577
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
1157811578
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
11579+
DEFAULT_BASE_REF: 'main',
1157911580
};
1158011581
const CONST = {
1158111582
...GIT_CONST,
@@ -12159,7 +12160,7 @@ class GithubUtils {
1215912160
/**
1216012161
* Get the contents of a file from the API at a given ref as a string.
1216112162
*/
12162-
static async getFileContents(path, ref = 'main') {
12163+
static async getFileContents(path, ref = CONST_1.default.DEFAULT_BASE_REF) {
1216312164
const { data } = await this.octokit.repos.getContent({
1216412165
owner: CONST_1.default.GITHUB_OWNER,
1216512166
repo: CONST_1.default.APP_REPO,

.github/actions/javascript/getDeployPullRequestList/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11762,6 +11762,7 @@ const GIT_CONST = {
1176211762
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
1176311763
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
1176411764
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
11765+
DEFAULT_BASE_REF: 'main',
1176511766
};
1176611767
const CONST = {
1176711768
...GIT_CONST,
@@ -12504,7 +12505,7 @@ class GithubUtils {
1250412505
/**
1250512506
* Get the contents of a file from the API at a given ref as a string.
1250612507
*/
12507-
static async getFileContents(path, ref = 'main') {
12508+
static async getFileContents(path, ref = CONST_1.default.DEFAULT_BASE_REF) {
1250812509
const { data } = await this.octokit.repos.getContent({
1250912510
owner: CONST_1.default.GITHUB_OWNER,
1251012511
repo: CONST_1.default.APP_REPO,

.github/actions/javascript/getPreviousVersion/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11573,6 +11573,7 @@ const GIT_CONST = {
1157311573
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
1157411574
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
1157511575
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
11576+
DEFAULT_BASE_REF: 'main',
1157611577
};
1157711578
const CONST = {
1157811579
...GIT_CONST,
@@ -12315,7 +12316,7 @@ class GithubUtils {
1231512316
/**
1231612317
* Get the contents of a file from the API at a given ref as a string.
1231712318
*/
12318-
static async getFileContents(path, ref = 'main') {
12319+
static async getFileContents(path, ref = CONST_1.default.DEFAULT_BASE_REF) {
1231912320
const { data } = await this.octokit.repos.getContent({
1232012321
owner: CONST_1.default.GITHUB_OWNER,
1232112322
repo: CONST_1.default.APP_REPO,

.github/actions/javascript/getPullRequestDetails/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11705,6 +11705,7 @@ const GIT_CONST = {
1170511705
GITHUB_OWNER: process.env.GITHUB_REPOSITORY_OWNER ?? 'Expensify',
1170611706
APP_REPO: (process.env.GITHUB_REPOSITORY ?? 'Expensify/App').split('/').at(1) ?? '',
1170711707
MOBILE_EXPENSIFY_REPO: 'Mobile-Expensify',
11708+
DEFAULT_BASE_REF: 'main',
1170811709
};
1170911710
const CONST = {
1171011711
...GIT_CONST,
@@ -12288,7 +12289,7 @@ class GithubUtils {
1228812289
/**
1228912290
* Get the contents of a file from the API at a given ref as a string.
1229012291
*/
12291-
static async getFileContents(path, ref = 'main') {
12292+
static async getFileContents(path, ref = CONST_1.default.DEFAULT_BASE_REF) {
1229212293
const { data } = await this.octokit.repos.getContent({
1229312294
owner: CONST_1.default.GITHUB_OWNER,
1229412295
repo: CONST_1.default.APP_REPO,

0 commit comments

Comments
 (0)