Skip to content

Commit

Permalink
Again
Browse files Browse the repository at this point in the history
  • Loading branch information
rehlma committed Apr 9, 2024
1 parent bab0544 commit db8d5f1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29021,8 +29021,8 @@ function run() {
const octokit = github.getOctokit(token);
const base = core.getInput('base');
const head = core.getInput('head');
const baseRef = base || ((_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.base.ref);
const headRef = head || ((_b = github.context.payload.pull_request) === null || _b === void 0 ? void 0 : _b.head.ref);
const baseRef = base || ((_a = github.context.payload.pull_request) === null || _a === void 0 ? void 0 : _a.base.sha);
const headRef = head || ((_b = github.context.payload.pull_request) === null || _b === void 0 ? void 0 : _b.head.sha);
if (!baseRef || !headRef) {
throw new Error('Base or head ref not found');
}
Expand Down Expand Up @@ -29105,7 +29105,7 @@ function generateComment(newTodos, removedTodos) {
console.log('Comment:', comment);
return comment;
}
function commentPr(octokit, comment, head, todoCount, doneCount) {
function commentPr(octokit, comment, headSha, todoCount, doneCount) {
return __awaiter(this, void 0, void 0, function* () {
var _a;
const { owner, repo } = github.context.repo;
Expand Down Expand Up @@ -29143,11 +29143,11 @@ function commentPr(octokit, comment, head, todoCount, doneCount) {
body: comment
});
}
console.log('Current head sha is:', head);
console.log('Current head sha is:', headSha);
yield octokit.rest.repos.createCommitStatus({
owner,
repo,
sha: head,
sha: headSha,
state: 'success',
description: `${doneCount}/${todoCount} TODOs checked`,
context: 'todo-check'
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ export async function run(): Promise<void> {
const base = core.getInput('base')
const head = core.getInput('head')

const baseRef = base || github.context.payload.pull_request?.base.ref
const headRef = head || github.context.payload.pull_request?.head.ref
const baseRef = base || github.context.payload.pull_request?.base.sha
const headRef = head || github.context.payload.pull_request?.head.sha

if (!baseRef || !headRef) {
throw new Error('Base or head ref not found')
Expand Down Expand Up @@ -105,7 +105,7 @@ function generateComment(newTodos: string[], removedTodos: string[]): string {
async function commentPr(
octokit: ReturnType<typeof github.getOctokit>,
comment: string,
head: string,
headSha: string,
todoCount: number,
doneCount: number
): Promise<void> {
Expand Down Expand Up @@ -147,12 +147,12 @@ async function commentPr(
})
}

console.log('Current head sha is:', head)
console.log('Current head sha is:', headSha)

await octokit.rest.repos.createCommitStatus({

Check failure on line 152 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Insert `⏎····`
owner,

Check failure on line 153 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Insert `··`
repo,

Check failure on line 154 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Insert `··`
sha: head,
sha: headSha,

Check failure on line 155 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Replace `····` with `······`
state: 'success',

Check failure on line 156 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Insert `··`
description: `${doneCount}/${todoCount} TODOs checked`,

Check failure on line 157 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Insert `··`
context: 'todo-check'

Check failure on line 158 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Insert `··`
Expand Down

0 comments on commit db8d5f1

Please sign in to comment.