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

Not print untrusted info to STDOUT. #205

Merged
merged 1 commit into from
Nov 2, 2020
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
12 changes: 6 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class IssueProcessor {
}
for (const issue of issues.values()) {
const isPr = !!issue.pull_request;
core.info(`Found issue: issue #${issue.number} - ${issue.title} last updated ${issue.updated_at} (is pr? ${isPr})`);
core.info(`Found issue: issue #${issue.number} last updated ${issue.updated_at} (is pr? ${isPr})`);
// calculate string based messages for this issue
const staleMessage = isPr
? this.options.stalePrMessage
Expand Down Expand Up @@ -172,7 +172,7 @@ class IssueProcessor {
// find any comments since the date
const comments = yield this.listIssueComments(issue.number, sinceDate);
const filteredComments = comments.filter(comment => comment.user.type === 'User' && comment.user.login !== github_1.context.actor);
core.info(`Comments not made by ${github_1.context.actor} or another bot: ${filteredComments.length}`);
core.info(`Comments not made by actor or another bot: ${filteredComments.length}`);
// if there are any user comments returned
return filteredComments.length > 0;
});
Expand Down Expand Up @@ -222,7 +222,7 @@ class IssueProcessor {
// Mark an issue as stale with a comment and a label
markStale(issue, staleMessage, staleLabel, skipMessage) {
return __awaiter(this, void 0, void 0, function* () {
core.info(`Marking issue #${issue.number} - ${issue.title} as stale`);
core.info(`Marking issue #${issue.number} as stale`);
this.staleIssues.push(issue);
this.operationsLeft -= 2;
// if the issue is being marked stale, the updated date should be changed to right now
Expand Down Expand Up @@ -261,7 +261,7 @@ class IssueProcessor {
// Close an issue based on staleness
closeIssue(issue, closeMessage, closeLabel) {
return __awaiter(this, void 0, void 0, function* () {
core.info(`Closing issue #${issue.number} - ${issue.title} for being stale`);
core.info(`Closing issue #${issue.number} for being stale`);
this.closedIssues.push(issue);
this.operationsLeft -= 1;
if (this.options.debugOnly) {
Expand Down Expand Up @@ -309,7 +309,7 @@ class IssueProcessor {
// Remove a label from an issue
removeLabel(issue, label) {
return __awaiter(this, void 0, void 0, function* () {
core.info(`Removing label ${label} from issue #${issue.number} - ${issue.title}`);
core.info(`Removing label from issue #${issue.number}`);
this.removedLabelIssues.push(issue);
this.operationsLeft -= 1;
if (this.options.debugOnly) {
Expand All @@ -332,7 +332,7 @@ class IssueProcessor {
///see https://developer.github.com/v3/activity/events/
getLabelCreationDate(issue, label) {
return __awaiter(this, void 0, void 0, function* () {
core.info(`Checking for label ${label} on issue #${issue.number}`);
core.info(`Checking for label on issue #${issue.number}`);
this.operationsLeft -= 1;
const options = this.client.issues.listEvents.endpoint.merge({
owner: github_1.context.repo.owner,
Expand Down
16 changes: 6 additions & 10 deletions src/IssueProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class IssueProcessor {
const isPr = !!issue.pull_request;

core.info(
`Found issue: issue #${issue.number} - ${issue.title} last updated ${issue.updated_at} (is pr? ${isPr})`
`Found issue: issue #${issue.number} last updated ${issue.updated_at} (is pr? ${isPr})`
);

// calculate string based messages for this issue
Expand Down Expand Up @@ -277,7 +277,7 @@ export class IssueProcessor {
);

core.info(
`Comments not made by ${context.actor} or another bot: ${filteredComments.length}`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note sure what to replace to for ${context.actor}

`Comments not made by actor or another bot: ${filteredComments.length}`
);

// if there are any user comments returned
Expand Down Expand Up @@ -336,7 +336,7 @@ export class IssueProcessor {
staleLabel: string,
skipMessage: boolean
): Promise<void> {
core.info(`Marking issue #${issue.number} - ${issue.title} as stale`);
core.info(`Marking issue #${issue.number} as stale`);

this.staleIssues.push(issue);

Expand Down Expand Up @@ -382,9 +382,7 @@ export class IssueProcessor {
closeMessage?: string,
closeLabel?: string
): Promise<void> {
core.info(
`Closing issue #${issue.number} - ${issue.title} for being stale`
);
core.info(`Closing issue #${issue.number} for being stale`);

this.closedIssues.push(issue);

Expand Down Expand Up @@ -434,9 +432,7 @@ export class IssueProcessor {

// Remove a label from an issue
private async removeLabel(issue: Issue, label: string): Promise<void> {
core.info(
`Removing label ${label} from issue #${issue.number} - ${issue.title}`
);
core.info(`Removing label from issue #${issue.number}`);

this.removedLabelIssues.push(issue);

Expand Down Expand Up @@ -464,7 +460,7 @@ export class IssueProcessor {
issue: Issue,
label: string
): Promise<string | undefined> {
core.info(`Checking for label ${label} on issue #${issue.number}`);
core.info(`Checking for label on issue #${issue.number}`);

this.operationsLeft -= 1;

Expand Down