Skip to content

Commit

Permalink
Rebuild gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
roryabraham committed Dec 22, 2023
1 parent cc62825 commit de167c7
Show file tree
Hide file tree
Showing 13 changed files with 218 additions and 10 deletions.
14 changes: 14 additions & 0 deletions .github/actions/javascript/authorChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/getDeployPullRequestList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/isStagingDeployLocked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/markPullRequestsAsDeployed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
60 changes: 50 additions & 10 deletions .github/actions/javascript/postTestBuildComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
/***/ 2052:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

const _ = __nccwpck_require__(5067);
const core = __nccwpck_require__(2186);
const {context} = __nccwpck_require__(5438);
const CONST = __nccwpck_require__(4097);
const GithubUtils = __nccwpck_require__(7999);

/**
Expand Down Expand Up @@ -59,20 +61,44 @@ function getTestBuildMessage() {
* @param {String} message
* @returns {Promise<void>}
*/
function commentPR(PR, message) {
async function commentPR(PR, message) {
console.log(`Posting test build comment on #${PR}`);
return GithubUtils.createComment(context.repo.repo, PR, message)
.then(() => console.log(`Comment created on #${PR} successfully 🎉`))
.catch((err) => {
console.log(`Unable to write comment on #${PR} 😞`);
core.setFailed(err.message);
});
try {
await GithubUtils.createComment(context.repo.repo, PR, message);
console.log(`Comment created on #${PR} successfully 🎉`);
} catch (err) {
console.log(`Unable to write comment on #${PR} 😞`);
core.setFailed(err.message);
}
}

const run = function () {
async function run() {
const PR_NUMBER = core.getInput('PR_NUMBER', {required: true});
return commentPR(PR_NUMBER, getTestBuildMessage()).then(() => Promise.resolve());
};
const comments = await GithubUtils.paginate(
GithubUtils.octokit.issues.listComments,
{
owner: CONST.GITHUB_OWNER,
repo: CONST.APP_REPO,
issue_number: PR_NUMBER,
per_page: 100,
},
(response) => response.data,
);
const testBuildComment = _.find(comments, (comment) => comment.body.startsWith(':test_tube::test_tube: Use the links below to test this adhoc build'));
if (testBuildComment) {
console.log('Found previous build comment, hiding it', testBuildComment);
await GithubUtils.graphql(`
mutation {
minimizeComment(input: {classifier: OUTDATED, subjectId: "${testBuildComment.node_id}"}) {
minimizedComment {
minimizedReason
}
}
}
`);
}
await commentPR(PR_NUMBER, getTestBuildMessage());
}

if (require.main === require.cache[eval('__filename')]) {
run();
Expand Down Expand Up @@ -178,6 +204,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/reopenIssueWithComment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/reviewerChecklist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down
14 changes: 14 additions & 0 deletions .github/actions/javascript/verifySignedCommits/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ class GithubUtils {
return this.internalOctokit.rest;
}

/**
* Get the graphql instance from internal octokit.
* @readonly
* @static
* @memberof GithubUtils
*/
static get graphql() {
if (this.internalOctokit) {
return this.internalOctokit.graphql;
}
this.initOctokit();
return this.internalOctokit.graphql;
}

/**
* Either give an existing instance of Octokit paginate or create a new one
*
Expand Down

0 comments on commit de167c7

Please sign in to comment.