forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
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 Expensify#46243 from Expensify/Rory-FixReleaseNames
[No QA] Prettier releases
- Loading branch information
Showing
18 changed files
with
45 additions
and
109 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
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
26 changes: 23 additions & 3 deletions
26
.github/actions/javascript/getReleaseBody/getReleaseBody.ts
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 |
---|---|---|
@@ -1,12 +1,32 @@ | ||
import * as core from '@actions/core'; | ||
import type {components as OctokitComponents} from '@octokit/openapi-types'; | ||
import * as ActionUtils from '@github/libs/ActionUtils'; | ||
import GithubUtils from '@github/libs/GithubUtils'; | ||
|
||
type GitHubPR = OctokitComponents['schemas']['pull-request-simple']; | ||
|
||
// Parse the stringified JSON array of PR numbers, and cast each from String -> Number | ||
const PRList = ActionUtils.getJSONInput('PR_LIST', {required: true}) as number[]; | ||
console.log('Got PR list: ', String(PRList)); | ||
|
||
const releaseBody = GithubUtils.getReleaseBody(PRList); | ||
console.log(`Generated release body: ${releaseBody}`); | ||
/** | ||
* Generate the well-formatted body of a production release. | ||
*/ | ||
function getReleaseBody(pullRequests: GitHubPR[]): string { | ||
return pullRequests.map((pr) => `- ${pr.title} by ${pr.user?.login ?? 'unknown'} in ${pr.html_url}`).join('\r\n'); | ||
} | ||
|
||
async function run() { | ||
const allPRs = await GithubUtils.fetchAllPullRequests(PRList); | ||
if (!allPRs) { | ||
core.setFailed(`something went wrong getting PRList ${JSON.stringify(PRList)}`); | ||
return; | ||
} | ||
const releaseBody = getReleaseBody(allPRs); | ||
console.log(`Generated release body: ${releaseBody}`); | ||
core.setOutput('RELEASE_BODY', releaseBody); | ||
} | ||
|
||
core.setOutput('RELEASE_BODY', releaseBody); | ||
if (require.main === module) { | ||
run(); | ||
} |
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
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