Skip to content

Commit 9120124

Browse files
committed
Merge branch 'main' into ts-migration/25218
2 parents 9a11ace + 39b575c commit 9120124

File tree

335 files changed

+23313
-3296
lines changed

Some content is hidden

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

335 files changed

+23313
-3296
lines changed

.github/actions/composite/buildAndroidE2EAPK/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ inputs:
55
ARTIFACT_NAME:
66
description: The name of the workflow artifact where the APK should be uploaded
77
required: true
8+
ARTIFACT_RETENTION_DAYS:
9+
description: The number of days to retain the artifact
10+
required: false
11+
# Thats github default:
12+
default: "90"
813
PACKAGE_SCRIPT_NAME:
914
description: The name of the npm script to run to build the APK
1015
required: true
@@ -69,7 +74,8 @@ runs:
6974
shell: bash
7075

7176
- name: Upload APK
72-
uses: actions/upload-artifact@65d862660abb392b8c4a3d1195a2108db131dd05
77+
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
7378
with:
7479
name: ${{ inputs.ARTIFACT_NAME }}
7580
path: ${{ inputs.APP_OUTPUT_PATH }}
81+
retention-days: ${{ inputs.ARTIFACT_RETENTION_DAYS }}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,14 @@ class GithubUtils {
557557
.then((events) => _.filter(events, (event) => event.event === 'closed'))
558558
.then((closedEvents) => lodashGet(_.last(closedEvents), 'actor.login', ''));
559559
}
560+
561+
static getArtifactByName(artefactName) {
562+
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
563+
owner: CONST.GITHUB_OWNER,
564+
repo: CONST.APP_REPO,
565+
per_page: 100,
566+
}).then((artifacts) => _.findWhere(artifacts, {name: artefactName}));
567+
}
560568
}
561569

562570
module.exports = GithubUtils;

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,14 @@ class GithubUtils {
669669
.then((events) => _.filter(events, (event) => event.event === 'closed'))
670670
.then((closedEvents) => lodashGet(_.last(closedEvents), 'actor.login', ''));
671671
}
672+
673+
static getArtifactByName(artefactName) {
674+
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
675+
owner: CONST.GITHUB_OWNER,
676+
repo: CONST.APP_REPO,
677+
per_page: 100,
678+
}).then((artifacts) => _.findWhere(artifacts, {name: artefactName}));
679+
}
672680
}
673681

674682
module.exports = GithubUtils;

.github/actions/javascript/bumpVersion/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ const incrementPatch = (major, minor, patch) => {
173173
/**
174174
* Increments a build version
175175
*
176-
* @param {Number} version
177-
* @param {Number} level
176+
* @param {String} version
177+
* @param {String} level
178178
* @returns {String}
179179
*/
180180
const incrementVersion = (version, level) => {

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,14 @@ class GithubUtils {
636636
.then((events) => _.filter(events, (event) => event.event === 'closed'))
637637
.then((closedEvents) => lodashGet(_.last(closedEvents), 'actor.login', ''));
638638
}
639+
640+
static getArtifactByName(artefactName) {
641+
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
642+
owner: CONST.GITHUB_OWNER,
643+
repo: CONST.APP_REPO,
644+
per_page: 100,
645+
}).then((artifacts) => _.findWhere(artifacts, {name: artefactName}));
646+
}
639647
}
640648

641649
module.exports = GithubUtils;

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,14 @@ class GithubUtils {
865865
.then((events) => _.filter(events, (event) => event.event === 'closed'))
866866
.then((closedEvents) => lodashGet(_.last(closedEvents), 'actor.login', ''));
867867
}
868+
869+
static getArtifactByName(artefactName) {
870+
return this.paginate(this.octokit.actions.listArtifactsForRepo, {
871+
owner: CONST.GITHUB_OWNER,
872+
repo: CONST.APP_REPO,
873+
per_page: 100,
874+
}).then((artifacts) => _.findWhere(artifacts, {name: artefactName}));
875+
}
868876
}
869877

870878
module.exports = GithubUtils;
@@ -978,8 +986,8 @@ const incrementPatch = (major, minor, patch) => {
978986
/**
979987
* Increments a build version
980988
*
981-
* @param {Number} version
982-
* @param {Number} level
989+
* @param {String} version
990+
* @param {String} level
983991
* @returns {String}
984992
*/
985993
const incrementVersion = (version, level) => {
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Get artifact info
2+
description: Gets the ID and workflow ID about a specific artifact. By default artifacts are only available in the same workflow. This action can be used to get the information needed to download an artifact from a different workflow.
3+
4+
inputs:
5+
GITHUB_TOKEN:
6+
description: Auth token for New Expensify Github; necessary for accessing Octokit.
7+
required: true
8+
ARTIFACT_NAME:
9+
description: Name of the artifact to get infos about (e.g. to use for downloading that artifact)
10+
required: true
11+
12+
outputs:
13+
ARTIFACT_FOUND:
14+
description: Whether the artifact was found
15+
ARTIFACT_ID:
16+
description: The ID of the artifact
17+
ARTIFACT_WORKFLOW_ID:
18+
description: The ID of the workflow that produced the artifact
19+
20+
runs:
21+
using: "node20"
22+
main: "index.js"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const _ = require('underscore');
2+
const core = require('@actions/core');
3+
const GithubUtils = require('../../../libs/GithubUtils');
4+
5+
const run = function () {
6+
const artifactName = core.getInput('ARTIFACT_NAME', {required: true});
7+
8+
return GithubUtils.getArtifactByName(artifactName)
9+
.then((artifact) => {
10+
if (_.isUndefined(artifact)) {
11+
console.log(`No artifact found with the name ${artifactName}`);
12+
core.setOutput('ARTIFACT_FOUND', false);
13+
return;
14+
}
15+
16+
console.log('Artifact info', artifact);
17+
core.setOutput('ARTIFACT_FOUND', true);
18+
core.setOutput('ARTIFACT_ID', artifact.id);
19+
core.setOutput('ARTIFACT_WORKFLOW_ID', artifact.workflow_run.id);
20+
})
21+
.catch((error) => {
22+
console.error('A problem occurred while trying to communicate with the GitHub API', error);
23+
core.setFailed(error);
24+
});
25+
};
26+
27+
if (require.main === module) {
28+
run();
29+
}
30+
31+
module.exports = run;

0 commit comments

Comments
 (0)