Skip to content

Commit

Permalink
Fix typo and add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurvasconcelos committed Jul 10, 2023
1 parent 1d5a6b2 commit b563834
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 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.

4 changes: 1 addition & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ async function run() {
const inputs = getInputs();
const prTitle: string = github.context.payload.pull_request?.title ?? '';
const prBody: string = github.context.payload.pull_request?.body ?? '';
core.info(`Current PR title: ${prTitle}.`);
core.info(`Current PR body: ${prBody}.`);
const newPrTitle = updateTitle(inputs, prTitle);
const newPrBody = updateBody(inputs, prBody);
const requestEndpoint: keyof Endpoints =
Expand All @@ -26,7 +24,7 @@ async function run() {
if (newPrTitle) updateRequest.title = newPrTitle;
if (newPrBody) updateRequest.body = newPrBody;

core.info(`Request: \n${updateRequest}.`);
core.info(`Request: \n${JSON.stringify(updateRequest)}.`);

if (!newPrTitle && !newPrBody) {
core.warning('No changes made to PR title or body. Exiting.');
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {RequestError} from '@octokit/types';

export function getInputs() {
return {
token: core.getInput('repo-token', {required: true}),
token: core.getInput('token', {required: true}),
title: core.getInput('title'),
titlePrefix: core.getInput('title-prefix'),
titleSuffix: core.getInput('title-suffix'),
Expand Down

0 comments on commit b563834

Please sign in to comment.