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

[No QA] Add deployer GH handle to deploy messages #4274

Merged
merged 3 commits into from
Aug 11, 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
17 changes: 17 additions & 0 deletions .github/actions/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,23 @@ class GithubUtils {
static isAutomatedPullRequest(pullRequest) {
return _.isEqual(lodashGet(pullRequest, 'user.login', ''), 'OSBotify');
}

/**
* Return the login of the actor who closed an issue or PR. If the issue is not closed, return an empty string.
*
* @param {Number} issueNumber
* @returns {Promise<String>}
*/
static getActorWhoClosedIssue(issueNumber) {
return this.octokit.paginate(this.octokit.issues.listEvents, {
owner: GITHUB_OWNER,
repo: EXPENSIFY_CASH_REPO,
issue_number: issueNumber,
per_page: 100,
})
.then(events => _.filter(events, event => event.event === 'closed'))
.then(closedEvents => lodashGet(_.last(closedEvents), 'actor.login', ''));
}
}

module.exports = GithubUtils;
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,23 @@ class GithubUtils {
static isAutomatedPullRequest(pullRequest) {
return _.isEqual(lodashGet(pullRequest, 'user.login', ''), 'OSBotify');
}

/**
* Return the login of the actor who closed an issue or PR. If the issue is not closed, return an empty string.
*
* @param {Number} issueNumber
* @returns {Promise<String>}
*/
static getActorWhoClosedIssue(issueNumber) {
return this.octokit.paginate(this.octokit.issues.listEvents, {
owner: GITHUB_OWNER,
repo: EXPENSIFY_CASH_REPO,
issue_number: issueNumber,
per_page: 100,
})
.then(events => _.filter(events, event => event.event === 'closed'))
.then(closedEvents => lodashGet(_.last(closedEvents), 'actor.login', ''));
}
}

module.exports = GithubUtils;
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/getMergeCommitForPullRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,23 @@ class GithubUtils {
static isAutomatedPullRequest(pullRequest) {
return _.isEqual(lodashGet(pullRequest, 'user.login', ''), 'OSBotify');
}

/**
* Return the login of the actor who closed an issue or PR. If the issue is not closed, return an empty string.
*
* @param {Number} issueNumber
* @returns {Promise<String>}
*/
static getActorWhoClosedIssue(issueNumber) {
return this.octokit.paginate(this.octokit.issues.listEvents, {
owner: GITHUB_OWNER,
repo: EXPENSIFY_CASH_REPO,
issue_number: issueNumber,
per_page: 100,
})
.then(events => _.filter(events, event => event.event === 'closed'))
.then(closedEvents => lodashGet(_.last(closedEvents), 'actor.login', ''));
}
}

module.exports = GithubUtils;
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,23 @@ class GithubUtils {
static isAutomatedPullRequest(pullRequest) {
return _.isEqual(lodashGet(pullRequest, 'user.login', ''), 'OSBotify');
}

/**
* Return the login of the actor who closed an issue or PR. If the issue is not closed, return an empty string.
*
* @param {Number} issueNumber
* @returns {Promise<String>}
*/
static getActorWhoClosedIssue(issueNumber) {
return this.octokit.paginate(this.octokit.issues.listEvents, {
owner: GITHUB_OWNER,
repo: EXPENSIFY_CASH_REPO,
issue_number: issueNumber,
per_page: 100,
})
.then(events => _.filter(events, event => event.event === 'closed'))
.then(closedEvents => lodashGet(_.last(closedEvents), 'actor.login', ''));
}
}

module.exports = GithubUtils;
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/isPullRequestMergeable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,23 @@ class GithubUtils {
static isAutomatedPullRequest(pullRequest) {
return _.isEqual(lodashGet(pullRequest, 'user.login', ''), 'OSBotify');
}

/**
* Return the login of the actor who closed an issue or PR. If the issue is not closed, return an empty string.
*
* @param {Number} issueNumber
* @returns {Promise<String>}
*/
static getActorWhoClosedIssue(issueNumber) {
return this.octokit.paginate(this.octokit.issues.listEvents, {
owner: GITHUB_OWNER,
repo: EXPENSIFY_CASH_REPO,
issue_number: issueNumber,
per_page: 100,
})
.then(events => _.filter(events, event => event.event === 'closed'))
.then(closedEvents => lodashGet(_.last(closedEvents), 'actor.login', ''));
}
}

module.exports = GithubUtils;
Expand Down
17 changes: 17 additions & 0 deletions .github/actions/isStagingDeployLocked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,23 @@ class GithubUtils {
static isAutomatedPullRequest(pullRequest) {
return _.isEqual(lodashGet(pullRequest, 'user.login', ''), 'OSBotify');
}

/**
* Return the login of the actor who closed an issue or PR. If the issue is not closed, return an empty string.
*
* @param {Number} issueNumber
* @returns {Promise<String>}
*/
static getActorWhoClosedIssue(issueNumber) {
return this.octokit.paginate(this.octokit.issues.listEvents, {
owner: GITHUB_OWNER,
repo: EXPENSIFY_CASH_REPO,
issue_number: issueNumber,
per_page: 100,
})
.then(events => _.filter(events, event => event.event === 'closed'))
.then(closedEvents => lodashGet(_.last(closedEvents), 'actor.login', ''));
}
}

module.exports = GithubUtils;
Expand Down
Loading