-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Expensify/main
Merge
- Loading branch information
Showing
63 changed files
with
1,097 additions
and
354 deletions.
There are no files selected for viewing
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
63 changes: 63 additions & 0 deletions
63
.github/actions/getDeployPullRequestList/getDeployPullRequestList.js
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,63 @@ | ||
const _ = require('underscore'); | ||
const core = require('@actions/core'); | ||
const github = require('@actions/github'); | ||
const GitUtils = require('../../libs/GitUtils'); | ||
|
||
const octokit = github.getOctokit(core.getInput('GITHUB_TOKEN', {required: true})); | ||
const inputTag = core.getInput('TAG', {required: true}); | ||
|
||
const isProductionDeploy = JSON.parse(core.getInput('IS_PRODUCTION_DEPLOY', {required: false})); | ||
const itemToFetch = isProductionDeploy ? 'release' : 'tag'; | ||
|
||
/** | ||
* Gets either releases or tags for a GitHub repo | ||
* | ||
* @param {boolean} fetchReleases | ||
* @returns {*} | ||
*/ | ||
function getTagsOrReleases(fetchReleases) { | ||
if (fetchReleases) { | ||
return octokit.repos.listReleases({ | ||
owner: github.context.repo.owner, | ||
repo: github.context.repo.repo, | ||
}); | ||
} | ||
|
||
return octokit.repos.listTags({ | ||
owner: github.context.repo.owner, | ||
repo: github.context.repo.repo, | ||
}); | ||
} | ||
|
||
console.log(`Fetching ${itemToFetch} list from github...`); | ||
getTagsOrReleases(isProductionDeploy) | ||
.catch(githubError => core.setFailed(githubError)) | ||
.then(({data}) => { | ||
const keyToPluck = isProductionDeploy ? 'tag_name' : 'name'; | ||
const tags = _.pluck(data, keyToPluck); | ||
const priorTagIndex = _.indexOf(tags, inputTag) + 1; | ||
|
||
if (priorTagIndex === 0) { | ||
console.log(`No ${itemToFetch} was found for input tag ${inputTag}.` | ||
+ `Comparing it to latest ${itemToFetch} ${tags[0]}`); | ||
} | ||
|
||
if (priorTagIndex === tags.length) { | ||
const err = new Error('Somehow, the input tag was at the end of the paginated result, ' | ||
+ 'so we don\'t have the prior tag'); | ||
console.error(err.message); | ||
core.setFailed(err); | ||
return; | ||
} | ||
|
||
const priorTag = tags[priorTagIndex]; | ||
console.log(`Given ${itemToFetch}: ${inputTag}`); | ||
console.log(`Prior ${itemToFetch}: ${priorTag}`); | ||
|
||
return GitUtils.getPullRequestsMergedBetween(priorTag, inputTag); | ||
}) | ||
.then((pullRequestList) => { | ||
console.log(`Found the pull request list: ${pullRequestList}`); | ||
return core.setOutput('PR_LIST', pullRequestList); | ||
}) | ||
.catch(error => core.setFailed(error)); |
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
38 changes: 0 additions & 38 deletions
38
.github/actions/getReleasePullRequestList/getReleasePullRequestList.js
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
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
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,5 @@ | ||
export default { | ||
hide: jest.fn().mockResolvedValueOnce(), | ||
show: jest.fn().mockResolvedValueOnce(), | ||
getVisibilityStatus: jest.fn().mockResolvedValue('hidden'), | ||
}; |
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,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:opacity="opaque"> | ||
<item android:drawable="@color/bootsplash_background" /> | ||
|
||
<item> | ||
<bitmap android:src="@mipmap/bootsplash_logo" android:gravity="center" /> | ||
</item> | ||
</layer-list> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,3 @@ | ||
<resources> | ||
<color name="bootsplash_background">#FFFFFF</color> | ||
</resources> |
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.