mirror of
https://github.com/actions/stale.git
synced 2026-06-25 20:22:42 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f4ddf3e2e8 | |||
| 546a4e9fd6 |
+43
-38
@@ -210,6 +210,7 @@ test('processing a stale issue containing a space in the label will close it', a
|
||||
|
||||
const processor = new IssueProcessor(
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
@@ -240,6 +241,7 @@ test('processing a stale issue containing a slash in the label will close it', a
|
||||
|
||||
const processor = new IssueProcessor(
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
@@ -430,8 +432,8 @@ test('stale closed prs will not be closed', async () => {
|
||||
DefaultProcessorOptions,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -457,7 +459,7 @@ test('locked issues will not be marked stale', async () => {
|
||||
const processor = new IssueProcessor(
|
||||
DefaultProcessorOptions,
|
||||
async () => 'abot',
|
||||
async p => p == 1 ? TestIssueList : []
|
||||
async p => (p == 1 ? TestIssueList : [])
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -484,8 +486,8 @@ test('stale locked issues will not be closed', async () => {
|
||||
DefaultProcessorOptions,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -511,7 +513,7 @@ test('locked prs will not be marked stale', async () => {
|
||||
const processor = new IssueProcessor(
|
||||
DefaultProcessorOptions,
|
||||
async () => 'abot',
|
||||
async p => p == 1 ? TestIssueList : []
|
||||
async p => (p == 1 ? TestIssueList : [])
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -538,8 +540,8 @@ test('stale locked prs will not be closed', async () => {
|
||||
DefaultProcessorOptions,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -563,8 +565,8 @@ test('exempt issue labels will not be marked stale', async () => {
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -586,8 +588,8 @@ test('exempt issue labels will not be marked stale (multi issue label with space
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -609,8 +611,8 @@ test('exempt issue labels will not be marked stale (multi issue label)', async (
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -635,8 +637,8 @@ test('exempt pr labels will not be marked stale', async () => {
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -661,8 +663,8 @@ test('stale issues should not be closed if days is set to -1', async () => {
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -690,8 +692,8 @@ test('stale label should be removed if a comment was added to a stale issue', as
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [{user: {login: 'notme', type: 'User'}}], // return a fake comment to indicate there was an update
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [{user: {login: 'notme', type: 'User'}}], // return a fake comment to indicate there was an update
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -721,8 +723,8 @@ test('stale label should not be removed if a comment was added by the bot (and t
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [{user: {login: 'abot', type: 'User'}}], // return a fake comment to indicate there was an update by the bot
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [{user: {login: 'abot', type: 'User'}}], // return a fake comment to indicate there was an update by the bot
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -752,9 +754,10 @@ test('stale label containing a space should be removed if a comment was added to
|
||||
|
||||
const processor = new IssueProcessor(
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [{user: {login: 'notme', type: 'User'}}], // return a fake comment to indicate there was an update
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [{user: {login: 'notme', type: 'User'}}], // return a fake comment to indicate there was an update
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -818,8 +821,8 @@ test('stale issues should be closed if the closed nubmer of days (additive) is a
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// process our fake issue list
|
||||
@@ -883,8 +886,8 @@ test('skips stale message on issues when skip-stale-issue-message is set', async
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// for sake of testing, mocking private function
|
||||
@@ -928,8 +931,8 @@ test('skips stale message on prs when skip-stale-pr-message is set', async () =>
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
// for sake of testing, mocking private function
|
||||
@@ -974,8 +977,8 @@ test('not providing state takes precedence over skipStaleIssueMessage', async ()
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
await processor.processIssues(1);
|
||||
@@ -1008,8 +1011,8 @@ test('not providing stalePrMessage takes precedence over skipStalePrMessage', as
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
await processor.processIssues(1);
|
||||
@@ -1035,9 +1038,10 @@ test('git branch is deleted when option is enabled', async () => {
|
||||
|
||||
const processor = new IssueProcessor(
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
await processor.processIssues(1);
|
||||
@@ -1063,9 +1067,10 @@ test('git branch is not deleted when issue is not pull request', async () => {
|
||||
|
||||
const processor = new IssueProcessor(
|
||||
opts,
|
||||
async () => 'abot',
|
||||
async p => (p == 1 ? TestIssueList : []),
|
||||
async (num, dt) => [],
|
||||
async (issue, label) => new Date().toDateString()
|
||||
async (num: number, dt: string) => [],
|
||||
async (issue: Issue, label: string) => new Date().toDateString()
|
||||
);
|
||||
|
||||
await processor.processIssues(1);
|
||||
|
||||
Vendored
+166
-109
@@ -3,7 +3,7 @@ module.exports =
|
||||
/******/ var __webpack_modules__ = ({
|
||||
|
||||
/***/ 407:
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -37,10 +37,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.IssueProcessor = void 0;
|
||||
const core = __importStar(__webpack_require__(186));
|
||||
const github_1 = __webpack_require__(438);
|
||||
const is_labeled_1 = __webpack_require__(792);
|
||||
const labels_to_list_1 = __webpack_require__(107);
|
||||
const core = __importStar(__nccwpck_require__(186));
|
||||
const github_1 = __nccwpck_require__(438);
|
||||
const is_labeled_1 = __nccwpck_require__(792);
|
||||
const labels_to_list_1 = __nccwpck_require__(107);
|
||||
/***
|
||||
* Handle processing of issues for staleness/closure.
|
||||
*/
|
||||
@@ -49,6 +49,7 @@ class IssueProcessor {
|
||||
this.operationsLeft = 0;
|
||||
this.staleIssues = [];
|
||||
this.closedIssues = [];
|
||||
this.deletedBranchIssues = [];
|
||||
this.removedLabelIssues = [];
|
||||
this.options = options;
|
||||
this.operationsLeft = options.operationsPerRun;
|
||||
@@ -119,6 +120,12 @@ class IssueProcessor {
|
||||
}
|
||||
// does this issue have a stale label?
|
||||
let isStale = is_labeled_1.isLabeled(issue, staleLabel);
|
||||
if (isStale) {
|
||||
core.info(`This issue has a stale label`);
|
||||
}
|
||||
else {
|
||||
core.info(`This issue hasn't a stale label`);
|
||||
}
|
||||
// should this issue be marked stale?
|
||||
const shouldBeStale = !IssueProcessor.updatedSince(issue.updated_at, this.options.daysBeforeStale);
|
||||
// determine if this issue needs to be marked stale first
|
||||
@@ -162,6 +169,11 @@ class IssueProcessor {
|
||||
if (!issueHasComments && !issueHasUpdate) {
|
||||
core.info(`Closing ${issueType} because it was last updated on ${issue.updated_at}`);
|
||||
yield this.closeIssue(issue, closeMessage, closeLabel);
|
||||
if (this.options.deleteBranch && issue.pull_request) {
|
||||
core.info(`Deleting branch for #${issue.number} as delete-branch option was specified`);
|
||||
yield this.deleteBranch(issue);
|
||||
this.deletedBranchIssues.push(issue);
|
||||
}
|
||||
}
|
||||
else {
|
||||
core.info(`Stale ${issueType} is not old enough to close yet (hasComments? ${issueHasComments}, hasUpdate? ${issueHasUpdate})`);
|
||||
@@ -325,12 +337,56 @@ class IssueProcessor {
|
||||
}
|
||||
});
|
||||
}
|
||||
getPullRequest(pullNumber) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
this.operationsLeft -= 1;
|
||||
try {
|
||||
const pullRequest = yield this.client.pulls.get({
|
||||
owner: github_1.context.repo.owner,
|
||||
repo: github_1.context.repo.repo,
|
||||
pull_number: pullNumber
|
||||
});
|
||||
return pullRequest.data;
|
||||
}
|
||||
catch (error) {
|
||||
core.error(`Error getting pull request ${pullNumber}: ${error.message}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Delete the branch on closed pull request
|
||||
deleteBranch(issue) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.info(`Delete branch from closed issue #${issue.number} - ${issue.title}`);
|
||||
if (this.options.debugOnly) {
|
||||
return;
|
||||
}
|
||||
const pullRequest = yield this.getPullRequest(issue.number);
|
||||
if (!pullRequest) {
|
||||
core.info(`Not deleting branch as pull request not found for issue ${issue.number}`);
|
||||
return;
|
||||
}
|
||||
const branch = pullRequest.head.ref;
|
||||
core.info(`Deleting branch ${branch} from closed issue #${issue.number}`);
|
||||
this.operationsLeft -= 1;
|
||||
try {
|
||||
yield this.client.git.deleteRef({
|
||||
owner: github_1.context.repo.owner,
|
||||
repo: github_1.context.repo.repo,
|
||||
ref: `heads/${branch}`
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
core.error(`Error deleting branch ${branch} from issue #${issue.number}: ${error.message}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Remove a label from an issue
|
||||
removeLabel(issue, label) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
core.info(`Removing label from issue #${issue.number}`);
|
||||
core.info(`Removing label "${label}" from issue #${issue.number}`);
|
||||
this.removedLabelIssues.push(issue);
|
||||
this.operationsLeft -= 1;
|
||||
// @todo remove the debug only to be able to test the code below
|
||||
if (this.options.debugOnly) {
|
||||
return;
|
||||
}
|
||||
@@ -339,7 +395,7 @@ class IssueProcessor {
|
||||
owner: github_1.context.repo.owner,
|
||||
repo: github_1.context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
name: encodeURIComponent(label) // A label can have a "?" in the name
|
||||
name: label
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
@@ -381,7 +437,7 @@ exports.IssueProcessor = IssueProcessor;
|
||||
/***/ }),
|
||||
|
||||
/***/ 792:
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -390,7 +446,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.isLabeled = void 0;
|
||||
const lodash_deburr_1 = __importDefault(__webpack_require__(601));
|
||||
const lodash_deburr_1 = __importDefault(__nccwpck_require__(601));
|
||||
/**
|
||||
* @description
|
||||
* Check if the label is listed as a label of the issue
|
||||
@@ -448,7 +504,7 @@ exports.labelsToList = labelsToList;
|
||||
/***/ }),
|
||||
|
||||
/***/ 109:
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -481,8 +537,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const core = __importStar(__webpack_require__(186));
|
||||
const IssueProcessor_1 = __webpack_require__(407);
|
||||
const core = __importStar(__nccwpck_require__(186));
|
||||
const IssueProcessor_1 = __nccwpck_require__(407);
|
||||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
@@ -517,7 +573,8 @@ function getAndValidateArgs() {
|
||||
debugOnly: core.getInput('debug-only') === 'true',
|
||||
ascending: core.getInput('ascending') === 'true',
|
||||
skipStalePrMessage: core.getInput('skip-stale-pr-message') === 'true',
|
||||
skipStaleIssueMessage: core.getInput('skip-stale-issue-message') === 'true'
|
||||
skipStaleIssueMessage: core.getInput('skip-stale-issue-message') === 'true',
|
||||
deleteBranch: core.getInput('delete-branch') === 'true'
|
||||
};
|
||||
for (const numberInput of [
|
||||
'days-before-stale',
|
||||
@@ -536,7 +593,7 @@ run();
|
||||
/***/ }),
|
||||
|
||||
/***/ 351:
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -548,8 +605,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const os = __importStar(__webpack_require__(87));
|
||||
const utils_1 = __webpack_require__(278);
|
||||
const os = __importStar(__nccwpck_require__(87));
|
||||
const utils_1 = __nccwpck_require__(278);
|
||||
/**
|
||||
* Commands
|
||||
*
|
||||
@@ -622,7 +679,7 @@ function escapeProperty(s) {
|
||||
/***/ }),
|
||||
|
||||
/***/ 186:
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -643,11 +700,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const command_1 = __webpack_require__(351);
|
||||
const file_command_1 = __webpack_require__(717);
|
||||
const utils_1 = __webpack_require__(278);
|
||||
const os = __importStar(__webpack_require__(87));
|
||||
const path = __importStar(__webpack_require__(622));
|
||||
const command_1 = __nccwpck_require__(351);
|
||||
const file_command_1 = __nccwpck_require__(717);
|
||||
const utils_1 = __nccwpck_require__(278);
|
||||
const os = __importStar(__nccwpck_require__(87));
|
||||
const path = __importStar(__nccwpck_require__(622));
|
||||
/**
|
||||
* The code to exit an action
|
||||
*/
|
||||
@@ -867,7 +924,7 @@ exports.getState = getState;
|
||||
/***/ }),
|
||||
|
||||
/***/ 717:
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -882,9 +939,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
// We use any as a valid input type
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
const fs = __importStar(__webpack_require__(747));
|
||||
const os = __importStar(__webpack_require__(87));
|
||||
const utils_1 = __webpack_require__(278);
|
||||
const fs = __importStar(__nccwpck_require__(747));
|
||||
const os = __importStar(__nccwpck_require__(87));
|
||||
const utils_1 = __nccwpck_require__(278);
|
||||
function issueCommand(command, message) {
|
||||
const filePath = process.env[`GITHUB_${command}`];
|
||||
if (!filePath) {
|
||||
@@ -929,14 +986,14 @@ exports.toCommandValue = toCommandValue;
|
||||
/***/ }),
|
||||
|
||||
/***/ 53:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.Context = void 0;
|
||||
const fs_1 = __webpack_require__(747);
|
||||
const os_1 = __webpack_require__(87);
|
||||
const fs_1 = __nccwpck_require__(747);
|
||||
const os_1 = __nccwpck_require__(87);
|
||||
class Context {
|
||||
/**
|
||||
* Hydrate the context from the environment
|
||||
@@ -986,7 +1043,7 @@ exports.Context = Context;
|
||||
/***/ }),
|
||||
|
||||
/***/ 438:
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -1011,8 +1068,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getOctokit = exports.context = void 0;
|
||||
const Context = __importStar(__webpack_require__(53));
|
||||
const utils_1 = __webpack_require__(30);
|
||||
const Context = __importStar(__nccwpck_require__(53));
|
||||
const utils_1 = __nccwpck_require__(30);
|
||||
exports.context = new Context.Context();
|
||||
/**
|
||||
* Returns a hydrated octokit ready to use for GitHub Actions
|
||||
@@ -1029,7 +1086,7 @@ exports.getOctokit = getOctokit;
|
||||
/***/ }),
|
||||
|
||||
/***/ 914:
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -1054,7 +1111,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0;
|
||||
const httpClient = __importStar(__webpack_require__(925));
|
||||
const httpClient = __importStar(__nccwpck_require__(925));
|
||||
function getAuthString(token, options) {
|
||||
if (!token && !options.auth) {
|
||||
throw new Error('Parameter token or opts.auth is required');
|
||||
@@ -1079,7 +1136,7 @@ exports.getApiBaseUrl = getApiBaseUrl;
|
||||
/***/ }),
|
||||
|
||||
/***/ 30:
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -1104,12 +1161,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.getOctokitOptions = exports.GitHub = exports.context = void 0;
|
||||
const Context = __importStar(__webpack_require__(53));
|
||||
const Utils = __importStar(__webpack_require__(914));
|
||||
const Context = __importStar(__nccwpck_require__(53));
|
||||
const Utils = __importStar(__nccwpck_require__(914));
|
||||
// octokit + plugins
|
||||
const core_1 = __webpack_require__(762);
|
||||
const plugin_rest_endpoint_methods_1 = __webpack_require__(44);
|
||||
const plugin_paginate_rest_1 = __webpack_require__(193);
|
||||
const core_1 = __nccwpck_require__(762);
|
||||
const plugin_rest_endpoint_methods_1 = __nccwpck_require__(44);
|
||||
const plugin_paginate_rest_1 = __nccwpck_require__(193);
|
||||
exports.context = new Context.Context();
|
||||
const baseUrl = Utils.getApiBaseUrl();
|
||||
const defaults = {
|
||||
@@ -1140,15 +1197,15 @@ exports.getOctokitOptions = getOctokitOptions;
|
||||
/***/ }),
|
||||
|
||||
/***/ 925:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const url = __webpack_require__(835);
|
||||
const http = __webpack_require__(605);
|
||||
const https = __webpack_require__(211);
|
||||
const pm = __webpack_require__(443);
|
||||
const url = __nccwpck_require__(835);
|
||||
const http = __nccwpck_require__(605);
|
||||
const https = __nccwpck_require__(211);
|
||||
const pm = __nccwpck_require__(443);
|
||||
let tunnel;
|
||||
var HttpCodes;
|
||||
(function (HttpCodes) {
|
||||
@@ -1558,7 +1615,7 @@ class HttpClient {
|
||||
if (useProxy) {
|
||||
// If using proxy, need tunnel
|
||||
if (!tunnel) {
|
||||
tunnel = __webpack_require__(294);
|
||||
tunnel = __nccwpck_require__(294);
|
||||
}
|
||||
const agentOptions = {
|
||||
maxSockets: maxSockets,
|
||||
@@ -1679,12 +1736,12 @@ exports.HttpClient = HttpClient;
|
||||
/***/ }),
|
||||
|
||||
/***/ 443:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const url = __webpack_require__(835);
|
||||
const url = __nccwpck_require__(835);
|
||||
function getProxyUrl(reqUrl) {
|
||||
let usingSsl = reqUrl.protocol === 'https:';
|
||||
let proxyUrl;
|
||||
@@ -1802,18 +1859,18 @@ exports.createTokenAuth = createTokenAuth;
|
||||
/***/ }),
|
||||
|
||||
/***/ 762:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
|
||||
var universalUserAgent = __webpack_require__(429);
|
||||
var beforeAfterHook = __webpack_require__(682);
|
||||
var request = __webpack_require__(234);
|
||||
var graphql = __webpack_require__(668);
|
||||
var authToken = __webpack_require__(334);
|
||||
var universalUserAgent = __nccwpck_require__(429);
|
||||
var beforeAfterHook = __nccwpck_require__(682);
|
||||
var request = __nccwpck_require__(234);
|
||||
var graphql = __nccwpck_require__(668);
|
||||
var authToken = __nccwpck_require__(334);
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
@@ -1986,7 +2043,7 @@ exports.Octokit = Octokit;
|
||||
/***/ }),
|
||||
|
||||
/***/ 440:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -1995,8 +2052,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var isPlainObject = _interopDefault(__webpack_require__(840));
|
||||
var universalUserAgent = __webpack_require__(429);
|
||||
var isPlainObject = _interopDefault(__nccwpck_require__(840));
|
||||
var universalUserAgent = __nccwpck_require__(429);
|
||||
|
||||
function lowercaseKeys(object) {
|
||||
if (!object) {
|
||||
@@ -2373,15 +2430,15 @@ exports.endpoint = endpoint;
|
||||
/***/ }),
|
||||
|
||||
/***/ 668:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
|
||||
var request = __webpack_require__(234);
|
||||
var universalUserAgent = __webpack_require__(429);
|
||||
var request = __nccwpck_require__(234);
|
||||
var universalUserAgent = __nccwpck_require__(429);
|
||||
|
||||
const VERSION = "4.5.2";
|
||||
|
||||
@@ -3819,7 +3876,7 @@ exports.restEndpointMethods = restEndpointMethods;
|
||||
/***/ }),
|
||||
|
||||
/***/ 537:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -3828,8 +3885,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var deprecation = __webpack_require__(932);
|
||||
var once = _interopDefault(__webpack_require__(223));
|
||||
var deprecation = __nccwpck_require__(932);
|
||||
var once = _interopDefault(__nccwpck_require__(223));
|
||||
|
||||
const logOnce = once(deprecation => console.warn(deprecation));
|
||||
/**
|
||||
@@ -3882,7 +3939,7 @@ exports.RequestError = RequestError;
|
||||
/***/ }),
|
||||
|
||||
/***/ 234:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -3891,11 +3948,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var endpoint = __webpack_require__(440);
|
||||
var universalUserAgent = __webpack_require__(429);
|
||||
var isPlainObject = _interopDefault(__webpack_require__(840));
|
||||
var nodeFetch = _interopDefault(__webpack_require__(467));
|
||||
var requestError = __webpack_require__(537);
|
||||
var endpoint = __nccwpck_require__(440);
|
||||
var universalUserAgent = __nccwpck_require__(429);
|
||||
var isPlainObject = _interopDefault(__nccwpck_require__(840));
|
||||
var nodeFetch = _interopDefault(__nccwpck_require__(467));
|
||||
var requestError = __nccwpck_require__(537);
|
||||
|
||||
const VERSION = "5.4.7";
|
||||
|
||||
@@ -4038,11 +4095,11 @@ exports.request = request;
|
||||
/***/ }),
|
||||
|
||||
/***/ 682:
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
var register = __webpack_require__(670)
|
||||
var addHook = __webpack_require__(549)
|
||||
var removeHook = __webpack_require__(819)
|
||||
var register = __nccwpck_require__(670)
|
||||
var addHook = __nccwpck_require__(549)
|
||||
var removeHook = __nccwpck_require__(819)
|
||||
|
||||
// bind with array of arguments: https://stackoverflow.com/a/21792913
|
||||
var bind = Function.bind
|
||||
@@ -4550,7 +4607,7 @@ module.exports = deburr;
|
||||
/***/ }),
|
||||
|
||||
/***/ 467:
|
||||
/***/ ((module, exports, __webpack_require__) => {
|
||||
/***/ ((module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -4559,11 +4616,11 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
|
||||
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
||||
|
||||
var Stream = _interopDefault(__webpack_require__(413));
|
||||
var http = _interopDefault(__webpack_require__(605));
|
||||
var Url = _interopDefault(__webpack_require__(835));
|
||||
var https = _interopDefault(__webpack_require__(211));
|
||||
var zlib = _interopDefault(__webpack_require__(761));
|
||||
var Stream = _interopDefault(__nccwpck_require__(413));
|
||||
var http = _interopDefault(__nccwpck_require__(605));
|
||||
var Url = _interopDefault(__nccwpck_require__(835));
|
||||
var https = _interopDefault(__nccwpck_require__(211));
|
||||
var zlib = _interopDefault(__nccwpck_require__(761));
|
||||
|
||||
// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
|
||||
|
||||
@@ -4714,7 +4771,7 @@ FetchError.prototype.name = 'FetchError';
|
||||
|
||||
let convert;
|
||||
try {
|
||||
convert = __webpack_require__(877).convert;
|
||||
convert = __nccwpck_require__(877).convert;
|
||||
} catch (e) {}
|
||||
|
||||
const INTERNALS = Symbol('Body internals');
|
||||
@@ -6207,9 +6264,9 @@ exports.FetchError = FetchError;
|
||||
/***/ }),
|
||||
|
||||
/***/ 223:
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
var wrappy = __webpack_require__(940)
|
||||
var wrappy = __nccwpck_require__(940)
|
||||
module.exports = wrappy(once)
|
||||
module.exports.strict = wrappy(onceStrict)
|
||||
|
||||
@@ -6256,26 +6313,26 @@ function onceStrict (fn) {
|
||||
/***/ }),
|
||||
|
||||
/***/ 294:
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
module.exports = __webpack_require__(219);
|
||||
module.exports = __nccwpck_require__(219);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 219:
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
|
||||
var net = __webpack_require__(631);
|
||||
var tls = __webpack_require__(16);
|
||||
var http = __webpack_require__(605);
|
||||
var https = __webpack_require__(211);
|
||||
var events = __webpack_require__(614);
|
||||
var assert = __webpack_require__(357);
|
||||
var util = __webpack_require__(669);
|
||||
var net = __nccwpck_require__(631);
|
||||
var tls = __nccwpck_require__(16);
|
||||
var http = __nccwpck_require__(605);
|
||||
var https = __nccwpck_require__(211);
|
||||
var events = __nccwpck_require__(614);
|
||||
var assert = __nccwpck_require__(357);
|
||||
var util = __nccwpck_require__(669);
|
||||
|
||||
|
||||
exports.httpOverHttp = httpOverHttp;
|
||||
@@ -6613,7 +6670,7 @@ module.exports = eval("require")("encoding");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("assert");
|
||||
module.exports = require("assert");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6621,7 +6678,7 @@ module.exports = require("assert");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("events");
|
||||
module.exports = require("events");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6629,7 +6686,7 @@ module.exports = require("events");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("fs");
|
||||
module.exports = require("fs");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6637,7 +6694,7 @@ module.exports = require("fs");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("http");
|
||||
module.exports = require("http");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6645,7 +6702,7 @@ module.exports = require("http");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("https");
|
||||
module.exports = require("https");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6653,7 +6710,7 @@ module.exports = require("https");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("net");
|
||||
module.exports = require("net");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6661,7 +6718,7 @@ module.exports = require("net");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("os");
|
||||
module.exports = require("os");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6669,7 +6726,7 @@ module.exports = require("os");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("path");
|
||||
module.exports = require("path");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6677,7 +6734,7 @@ module.exports = require("path");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("stream");
|
||||
module.exports = require("stream");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6685,7 +6742,7 @@ module.exports = require("stream");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("tls");
|
||||
module.exports = require("tls");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6693,7 +6750,7 @@ module.exports = require("tls");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("url");
|
||||
module.exports = require("url");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6701,7 +6758,7 @@ module.exports = require("url");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("util");
|
||||
module.exports = require("util");;
|
||||
|
||||
/***/ }),
|
||||
|
||||
@@ -6709,7 +6766,7 @@ module.exports = require("util");
|
||||
/***/ ((module) => {
|
||||
|
||||
"use strict";
|
||||
module.exports = require("zlib");
|
||||
module.exports = require("zlib");;
|
||||
|
||||
/***/ })
|
||||
|
||||
@@ -6719,7 +6776,7 @@ module.exports = require("zlib");
|
||||
/******/ var __webpack_module_cache__ = {};
|
||||
/******/
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
/******/ function __nccwpck_require__(moduleId) {
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(__webpack_module_cache__[moduleId]) {
|
||||
/******/ return __webpack_module_cache__[moduleId].exports;
|
||||
@@ -6734,7 +6791,7 @@ module.exports = require("zlib");
|
||||
/******/ // Execute the module function
|
||||
/******/ var threw = true;
|
||||
/******/ try {
|
||||
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __nccwpck_require__);
|
||||
/******/ threw = false;
|
||||
/******/ } finally {
|
||||
/******/ if(threw) delete __webpack_module_cache__[moduleId];
|
||||
@@ -6747,10 +6804,10 @@ module.exports = require("zlib");
|
||||
/************************************************************************/
|
||||
/******/ /* webpack/runtime/compat */
|
||||
/******/
|
||||
/******/ __webpack_require__.ab = __dirname + "/";/************************************************************************/
|
||||
/******/ __nccwpck_require__.ab = __dirname + "/";/************************************************************************/
|
||||
/******/ // module exports must be returned from runtime so entry inlining is disabled
|
||||
/******/ // startup
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(109);
|
||||
/******/ return __nccwpck_require__(109);
|
||||
/******/ })()
|
||||
;
|
||||
Generated
+2512
-1608
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -42,11 +42,11 @@
|
||||
"eslint": "^7.17.0",
|
||||
"eslint-plugin-github": "^4.0.1",
|
||||
"eslint-plugin-jest": "^24.1.3",
|
||||
"jest": "^24.9.0",
|
||||
"jest": "^26.6.3",
|
||||
"jest-circus": "^26.6.3",
|
||||
"js-yaml": "^3.14.0",
|
||||
"prettier": "^2.2.1",
|
||||
"ts-jest": "^24.2.0",
|
||||
"ts-jest": "^26.4.4",
|
||||
"typescript": "^4.1.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,8 +309,7 @@ export class IssueProcessor {
|
||||
const comments = await this.listIssueComments(issue.number, sinceDate);
|
||||
|
||||
const filteredComments = comments.filter(
|
||||
comment =>
|
||||
comment.user.type === 'User' && comment.user.login !== actor
|
||||
comment => comment.user.type === 'User' && comment.user.login !== actor
|
||||
);
|
||||
|
||||
core.info(
|
||||
@@ -347,10 +346,10 @@ export class IssueProcessor {
|
||||
try {
|
||||
actor = await this.client.users.getAuthenticated();
|
||||
} catch (error) {
|
||||
return context.actor
|
||||
return context.actor;
|
||||
}
|
||||
|
||||
return actor.data.login
|
||||
return actor.data.login;
|
||||
}
|
||||
|
||||
// grab issues from github in baches of 100
|
||||
|
||||
Reference in New Issue
Block a user