Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Expensify/App
Browse files Browse the repository at this point in the history
  • Loading branch information
perunt committed Jun 21, 2024
2 parents beb8e38 + 633e708 commit 3734b75
Show file tree
Hide file tree
Showing 421 changed files with 7,062 additions and 4,169 deletions.
44 changes: 35 additions & 9 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17073,13 +17073,11 @@ const CONST_1 = __importDefault(__nccwpck_require__(9873));
class GithubUtils {
static internalOctokit;
/**
* Initialize internal octokit
*
* @private
* Initialize internal octokit.
* NOTE: When using GithubUtils in CI, you don't need to call this manually.
*/
static initOctokit() {
static initOctokitWithToken(token) {
const Octokit = utils_1.GitHub.plugin(plugin_throttling_1.throttling, plugin_paginate_rest_1.paginateRest);
const token = core.getInput('GITHUB_TOKEN', { required: true });
// Save a copy of octokit used in this class
this.internalOctokit = new Octokit((0, utils_1.getOctokitOptions)(token, {
throttle: {
Expand All @@ -17099,6 +17097,15 @@ class GithubUtils {
},
}));
}
/**
* Default initialize method assuming running in CI, getting the token from an input.
*
* @private
*/
static initOctokit() {
const token = core.getInput('GITHUB_TOKEN', { required: true });
this.initOctokitWithToken(token);
}
/**
* Either give an existing instance of Octokit rest or create a new one
*
Expand Down Expand Up @@ -17454,12 +17461,31 @@ class GithubUtils {
.then((events) => events.filter((event) => event.event === 'closed'))
.then((closedEvents) => closedEvents.at(-1)?.actor?.login ?? '');
}
static getArtifactByName(artefactName) {
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
/**
* Returns a single artifact by name. If none is found, it returns undefined.
*/
static getArtifactByName(artifactName) {
return this.octokit.actions
.listArtifactsForRepo({
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
per_page: 100,
}).then((artifacts) => artifacts.find((artifact) => artifact.name === artefactName));
per_page: 1,
name: artifactName,
})
.then((response) => response.data.artifacts[0]);
}
/**
* Given an artifact ID, returns the download URL to a zip file containing the artifact.
*/
static getArtifactDownloadURL(artifactId) {
return this.octokit.actions
.downloadArtifact({
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
artifact_id: artifactId,
archive_format: 'zip',
})
.then((response) => response.url);
}
}
exports["default"] = GithubUtils;
Expand Down
44 changes: 35 additions & 9 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12314,13 +12314,11 @@ const CONST_1 = __importDefault(__nccwpck_require__(9873));
class GithubUtils {
static internalOctokit;
/**
* Initialize internal octokit
*
* @private
* Initialize internal octokit.
* NOTE: When using GithubUtils in CI, you don't need to call this manually.
*/
static initOctokit() {
static initOctokitWithToken(token) {
const Octokit = utils_1.GitHub.plugin(plugin_throttling_1.throttling, plugin_paginate_rest_1.paginateRest);
const token = core.getInput('GITHUB_TOKEN', { required: true });
// Save a copy of octokit used in this class
this.internalOctokit = new Octokit((0, utils_1.getOctokitOptions)(token, {
throttle: {
Expand All @@ -12340,6 +12338,15 @@ class GithubUtils {
},
}));
}
/**
* Default initialize method assuming running in CI, getting the token from an input.
*
* @private
*/
static initOctokit() {
const token = core.getInput('GITHUB_TOKEN', { required: true });
this.initOctokitWithToken(token);
}
/**
* Either give an existing instance of Octokit rest or create a new one
*
Expand Down Expand Up @@ -12695,12 +12702,31 @@ class GithubUtils {
.then((events) => events.filter((event) => event.event === 'closed'))
.then((closedEvents) => closedEvents.at(-1)?.actor?.login ?? '');
}
static getArtifactByName(artefactName) {
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
/**
* Returns a single artifact by name. If none is found, it returns undefined.
*/
static getArtifactByName(artifactName) {
return this.octokit.actions
.listArtifactsForRepo({
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
per_page: 100,
}).then((artifacts) => artifacts.find((artifact) => artifact.name === artefactName));
per_page: 1,
name: artifactName,
})
.then((response) => response.data.artifacts[0]);
}
/**
* Given an artifact ID, returns the download URL to a zip file containing the artifact.
*/
static getArtifactDownloadURL(artifactId) {
return this.octokit.actions
.downloadArtifact({
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
artifact_id: artifactId,
archive_format: 'zip',
})
.then((response) => response.url);
}
}
exports["default"] = GithubUtils;
Expand Down
44 changes: 35 additions & 9 deletions .github/actions/javascript/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11597,13 +11597,11 @@ const CONST_1 = __importDefault(__nccwpck_require__(9873));
class GithubUtils {
static internalOctokit;
/**
* Initialize internal octokit
*
* @private
* Initialize internal octokit.
* NOTE: When using GithubUtils in CI, you don't need to call this manually.
*/
static initOctokit() {
static initOctokitWithToken(token) {
const Octokit = utils_1.GitHub.plugin(plugin_throttling_1.throttling, plugin_paginate_rest_1.paginateRest);
const token = core.getInput('GITHUB_TOKEN', { required: true });
// Save a copy of octokit used in this class
this.internalOctokit = new Octokit((0, utils_1.getOctokitOptions)(token, {
throttle: {
Expand All @@ -11623,6 +11621,15 @@ class GithubUtils {
},
}));
}
/**
* Default initialize method assuming running in CI, getting the token from an input.
*
* @private
*/
static initOctokit() {
const token = core.getInput('GITHUB_TOKEN', { required: true });
this.initOctokitWithToken(token);
}
/**
* Either give an existing instance of Octokit rest or create a new one
*
Expand Down Expand Up @@ -11978,12 +11985,31 @@ class GithubUtils {
.then((events) => events.filter((event) => event.event === 'closed'))
.then((closedEvents) => closedEvents.at(-1)?.actor?.login ?? '');
}
static getArtifactByName(artefactName) {
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
/**
* Returns a single artifact by name. If none is found, it returns undefined.
*/
static getArtifactByName(artifactName) {
return this.octokit.actions
.listArtifactsForRepo({
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
per_page: 100,
}).then((artifacts) => artifacts.find((artifact) => artifact.name === artefactName));
per_page: 1,
name: artifactName,
})
.then((response) => response.data.artifacts[0]);
}
/**
* Given an artifact ID, returns the download URL to a zip file containing the artifact.
*/
static getArtifactDownloadURL(artifactId) {
return this.octokit.actions
.downloadArtifact({
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
artifact_id: artifactId,
archive_format: 'zip',
})
.then((response) => response.url);
}
}
exports["default"] = GithubUtils;
Expand Down
44 changes: 35 additions & 9 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14567,13 +14567,11 @@ const CONST_1 = __importDefault(__nccwpck_require__(9873));
class GithubUtils {
static internalOctokit;
/**
* Initialize internal octokit
*
* @private
* Initialize internal octokit.
* NOTE: When using GithubUtils in CI, you don't need to call this manually.
*/
static initOctokit() {
static initOctokitWithToken(token) {
const Octokit = utils_1.GitHub.plugin(plugin_throttling_1.throttling, plugin_paginate_rest_1.paginateRest);
const token = core.getInput('GITHUB_TOKEN', { required: true });
// Save a copy of octokit used in this class
this.internalOctokit = new Octokit((0, utils_1.getOctokitOptions)(token, {
throttle: {
Expand All @@ -14593,6 +14591,15 @@ class GithubUtils {
},
}));
}
/**
* Default initialize method assuming running in CI, getting the token from an input.
*
* @private
*/
static initOctokit() {
const token = core.getInput('GITHUB_TOKEN', { required: true });
this.initOctokitWithToken(token);
}
/**
* Either give an existing instance of Octokit rest or create a new one
*
Expand Down Expand Up @@ -14948,12 +14955,31 @@ class GithubUtils {
.then((events) => events.filter((event) => event.event === 'closed'))
.then((closedEvents) => closedEvents.at(-1)?.actor?.login ?? '');
}
static getArtifactByName(artefactName) {
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
/**
* Returns a single artifact by name. If none is found, it returns undefined.
*/
static getArtifactByName(artifactName) {
return this.octokit.actions
.listArtifactsForRepo({
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
per_page: 100,
}).then((artifacts) => artifacts.find((artifact) => artifact.name === artefactName));
per_page: 1,
name: artifactName,
})
.then((response) => response.data.artifacts[0]);
}
/**
* Given an artifact ID, returns the download URL to a zip file containing the artifact.
*/
static getArtifactDownloadURL(artifactId) {
return this.octokit.actions
.downloadArtifact({
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
artifact_id: artifactId,
archive_format: 'zip',
})
.then((response) => response.url);
}
}
exports["default"] = GithubUtils;
Expand Down
44 changes: 35 additions & 9 deletions .github/actions/javascript/getArtifactInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11558,13 +11558,11 @@ const CONST_1 = __importDefault(__nccwpck_require__(9873));
class GithubUtils {
static internalOctokit;
/**
* Initialize internal octokit
*
* @private
* Initialize internal octokit.
* NOTE: When using GithubUtils in CI, you don't need to call this manually.
*/
static initOctokit() {
static initOctokitWithToken(token) {
const Octokit = utils_1.GitHub.plugin(plugin_throttling_1.throttling, plugin_paginate_rest_1.paginateRest);
const token = core.getInput('GITHUB_TOKEN', { required: true });
// Save a copy of octokit used in this class
this.internalOctokit = new Octokit((0, utils_1.getOctokitOptions)(token, {
throttle: {
Expand All @@ -11584,6 +11582,15 @@ class GithubUtils {
},
}));
}
/**
* Default initialize method assuming running in CI, getting the token from an input.
*
* @private
*/
static initOctokit() {
const token = core.getInput('GITHUB_TOKEN', { required: true });
this.initOctokitWithToken(token);
}
/**
* Either give an existing instance of Octokit rest or create a new one
*
Expand Down Expand Up @@ -11939,12 +11946,31 @@ class GithubUtils {
.then((events) => events.filter((event) => event.event === 'closed'))
.then((closedEvents) => closedEvents.at(-1)?.actor?.login ?? '');
}
static getArtifactByName(artefactName) {
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
/**
* Returns a single artifact by name. If none is found, it returns undefined.
*/
static getArtifactByName(artifactName) {
return this.octokit.actions
.listArtifactsForRepo({
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
per_page: 100,
}).then((artifacts) => artifacts.find((artifact) => artifact.name === artefactName));
per_page: 1,
name: artifactName,
})
.then((response) => response.data.artifacts[0]);
}
/**
* Given an artifact ID, returns the download URL to a zip file containing the artifact.
*/
static getArtifactDownloadURL(artifactId) {
return this.octokit.actions
.downloadArtifact({
owner: CONST_1.default.GITHUB_OWNER,
repo: CONST_1.default.APP_REPO,
artifact_id: artifactId,
archive_format: 'zip',
})
.then((response) => response.url);
}
}
exports["default"] = GithubUtils;
Expand Down
Loading

0 comments on commit 3734b75

Please sign in to comment.