Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
fix: use core.info() instead of core.debug()
Browse files Browse the repository at this point in the history
debug() is not meant to be used as console.log
  • Loading branch information
z0al committed Dec 3, 2020
1 parent dc7a75c commit 816bd79
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
18 changes: 9 additions & 9 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/__tests__/action.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jest.mock('@actions/core', () => {
getInput: jest
.fn()
.mockImplementation((key: string) => (inputs as any)[key]),
debug: jest.fn(),
info: jest.fn(),
startGroup: jest.fn(),
endGroup: jest.fn(),
};
Expand Down
12 changes: 6 additions & 6 deletions src/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function checkIssues(context: ActionContext) {
let dependencies = extractor.fromIssue(issue);

if (dependencies.length === 0) {
core.debug('No dependencies found. Running clean-up');
core.info('No dependencies found. Running clean-up');
await manager.removeLabel(issue);
await manager.removeActionComments(issue);
await manager.updateCommitStatus(issue, []);
Expand All @@ -34,7 +34,7 @@ export async function checkIssues(context: ActionContext) {

let isBlocked = false;

core.debug(
core.info(
`Depends on: ${dependencies
.map((dep) => formatDependency(dep, repo))
.join(', ')}`
Expand All @@ -51,27 +51,27 @@ export async function checkIssues(context: ActionContext) {
})
);

core.debug(
core.info(
`Blocked by: ${dependencies
.filter((dep) => dep.blocker)
.map((dep) => formatDependency(dep, repo))
.join(', ')}`
);

core.debug('Updating labels');
core.info('Updating labels');
// Toggle label
isBlocked
? await manager.addLabel(issue)
: await manager.removeLabel(issue);

core.debug('Updating Action comments');
core.info('Updating Action comments');
await manager.writeComment(
issue,
manager.generateComment(dependencies, dependencies, config),
!isBlocked
);

core.debug(
core.info(
`Updating PR status${issue.pull_request ? '' : '. Skipped'}`
);
await manager.updateCommitStatus(issue, dependencies);
Expand Down
6 changes: 3 additions & 3 deletions src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function getActionContext(): Promise<ActionContext> {

// Only run checks for the context.issue (if any)
if (issue?.number) {
core.debug(`Payload issue: #${issue?.number}`);
core.info(`Payload issue: #${issue?.number}`);
const remoteIssue = (
await client.issues.get({ ...repo, issue_number: issue.number })
).data;
Expand All @@ -51,7 +51,7 @@ export async function getActionContext(): Promise<ActionContext> {

// Otherwise, check all open issues
else {
core.debug(`Payload issue: None`);
core.info(`Payload issue: None`);
const options = {
...repo,
state: 'open' as 'open',
Expand All @@ -64,7 +64,7 @@ export async function getActionContext(): Promise<ActionContext> {
: client.pulls.list;

issues = (await client.paginate(method, options)) as Issue[];
core.debug(`No. of open issues: ${issues.length}`);
core.info(`No. of open issues: ${issues.length}`);
}

core.endGroup();
Expand Down

0 comments on commit 816bd79

Please sign in to comment.