Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17400,12 +17400,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12641,12 +12641,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/javascript/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11924,12 +11924,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14954,12 +14954,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/javascript/getArtifactInfo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11885,12 +11885,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12233,12 +12233,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/javascript/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11987,12 +11987,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
26 changes: 23 additions & 3 deletions .github/actions/javascript/getReleaseBody/getReleaseBody.ts
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();
}
28 changes: 19 additions & 9 deletions .github/actions/javascript/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11459,9 +11459,25 @@ const GithubUtils_1 = __importDefault(__nccwpck_require__(9296));
// Parse the stringified JSON array of PR numbers, and cast each from String -> Number
const PRList = ActionUtils.getJSONInput('PR_LIST', { required: true });
console.log('Got PR list: ', String(PRList));
const releaseBody = GithubUtils_1.default.getReleaseBody(PRList);
console.log(`Generated release body: ${releaseBody}`);
core.setOutput('RELEASE_BODY', releaseBody);
/**
* Generate the well-formatted body of a production release.
*/
function getReleaseBody(pullRequests) {
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_1.default.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);
}
if (require.main === require.cache[eval('__filename')]) {
run();
}


/***/ }),
Expand Down Expand Up @@ -11931,12 +11947,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/javascript/isStagingDeployLocked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11885,12 +11885,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12092,12 +12092,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/javascript/postTestBuildComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11984,12 +11984,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/javascript/reopenIssueWithComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11895,12 +11895,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/javascript/reviewerChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11987,12 +11987,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
6 changes: 0 additions & 6 deletions .github/actions/javascript/verifySignedCommits/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11927,12 +11927,6 @@ class GithubUtils {
})
.then((response) => response.data.workflow_runs[0]?.id);
}
/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests) {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}
/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
7 changes: 0 additions & 7 deletions .github/libs/GithubUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,13 +462,6 @@ class GithubUtils {
.then((response) => response.data.workflow_runs[0]?.id);
}

/**
* Generate the well-formatted body of a production release.
*/
static getReleaseBody(pullRequests: number[]): string {
return pullRequests.map((number) => `- ${this.getPullRequestURLFromNumber(number)}`).join('\r\n');
}

/**
* Generate the URL of an New Expensify pull request given the PR number.
*/
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: 🚀 Push tags to trigger staging deploy 🚀
run: git push --tags

- name: Warn deployers if staging deploy failed
if: ${{ failure() }}
uses: 8398a7/action-slack@v3
Expand Down Expand Up @@ -83,10 +83,10 @@ jobs:
PR_LIST: ${{ steps.getReleasePRList.outputs.PR_LIST }}

- name: 🚀 Create release to trigger production deploy 🚀
run: gh release create ${{ env.PRODUCTION_VERSION }} --notes '${{ steps.getReleaseBody.outputs.RELEASE_BODY }}'
run: gh release create ${{ env.PRODUCTION_VERSION }} --title ${{ env.PRODUCTION_VERSION }} --notes '${{ steps.getReleaseBody.outputs.RELEASE_BODY }}'
env:
GITHUB_TOKEN: ${{ steps.setupGitForOSBotify.outputs.OS_BOTIFY_API_TOKEN }}

- name: Warn deployers if production deploy failed
if: ${{ failure() }}
uses: 8398a7/action-slack@v3
Expand Down
9 changes: 0 additions & 9 deletions tests/unit/GithubUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,13 +621,4 @@ describe('GithubUtils', () => {
[54321, 'https://github.com/Expensify/App/pull/54321'],
])('getPullRequestNumberFromURL("%s")', (input, expectedOutput) => expect(GithubUtils.getPullRequestURLFromNumber(input)).toBe(expectedOutput));
});

describe('getReleaseBody', () => {
test.each([
// eslint-disable-next-line max-len
[[1, 2, 3], '- https://github.com/Expensify/App/pull/1\r\n- https://github.com/Expensify/App/pull/2\r\n- https://github.com/Expensify/App/pull/3'],
[[], ''],
[[12345], '- https://github.com/Expensify/App/pull/12345'],
])('getReleaseBody("%s")', (input, expectedOutput) => expect(GithubUtils.getReleaseBody(input)).toBe(expectedOutput));
});
});