Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create production release #1859

Merged
merged 3 commits into from
Mar 18, 2021
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
13 changes: 13 additions & 0 deletions .github/actions/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,19 @@ class GithubUtils {
});
}

/**
* Generate the well-formatted body of a production release.
*
* @param {Array} pullRequests
* @returns {String}
*/
static getReleaseBody(pullRequests) {
return _.map(
pullRequests,
number => `- ${this.getPullRequestURLFromNumber(number)}`,
).join('\r\n');
}

/**
* Generate the URL of an Expensify.cash pull request given the PR number.
*
Expand Down
12 changes: 12 additions & 0 deletions .github/actions/getReleaseBody/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Get Release Body'
description: 'Generate the body of a production release'
inputs:
PR_LIST:
description: JSON array of pull request numbers (string)
required: true
outputs:
RELEASE_BODY:
description: String body of a production release.
runs:
using: 'node12'
main: './index.js'
12 changes: 12 additions & 0 deletions .github/actions/getReleaseBody/getReleaseBody.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const _ = require('underscore');
const core = require('@actions/core');
const GithubUtils = require('../../libs/GithubUtils');

// Parse the stringified JSON array of PR numbers, and cast each from String -> Number
const PRList = _.map(JSON.parse(core.getInput('PR_LIST', {required: true})), Number);
console.log(`Got PR list: ${PRList}`);

const releaseBody = GithubUtils.getReleaseBody(PRList);
console.log(`Generated release body: ${releaseBody}`);

core.setOutput('RELEASE_BODY', releaseBody);
Loading