Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Mar 18, 2024
1 parent 4877388 commit 1bb0fea
Show file tree
Hide file tree
Showing 11 changed files with 195 additions and 11 deletions.
50 changes: 50 additions & 0 deletions dist/action.js

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

1 change: 1 addition & 0 deletions dist/action.js.map

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

10 changes: 9 additions & 1 deletion 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.

28 changes: 28 additions & 0 deletions dist/main.js

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

1 change: 1 addition & 0 deletions dist/main.js.map

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

88 changes: 88 additions & 0 deletions dist/pull-request.js

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

1 change: 1 addition & 0 deletions dist/pull-request.js.map

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

2 changes: 2 additions & 0 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ async function action(pr: PullRequest, octokit: CustomOctokit): Promise<void> {
await delay(delaySeconds);
}

warning('action');
const config = await Config.getConfig(octokit);
warning('action2');

const tag = new Tag(await Tag.getLatestTag());

Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getInput, setFailed } from '@actions/core';
import { getInput, setFailed, warning } from '@actions/core';

import '@total-typescript/ts-reset';

Expand All @@ -14,8 +14,11 @@ const prMetadataUnsafe = getInput('pr-number', { required: true });
const prMetadata = inputPrNumberSchema.parse(prMetadataUnsafe);

try {
warning('main');
const pr = new PullRequest(prMetadata, octokit);
warning('main2');
await pr.initialize();
warning('main3');
await action(pr, octokit);
} catch (error) {
let message: string;
Expand Down
18 changes: 10 additions & 8 deletions src/pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ export class PullRequest {
}

async setPullRequestData() {
const prData = pullRequestDataSchema.parse(
await this.octokit.request(
'GET /repos/{owner}/{repo}/pulls/{pull_number}',
{
...context.repo,
pull_number: this.id,
}
)
warning(`"${JSON.stringify(context.repo)}"`);
const prDataUnsafe = await this.octokit.request(
'GET /repos/{owner}/{repo}/pulls/{pull_number}',
{
...context.repo,
pull_number: this.id,
}
);
warning(`"${JSON.stringify(prDataUnsafe)}"`);

const prData = pullRequestDataSchema.parse(prDataUnsafe.data);

this.labels = prData.labels.map(label => label.name);
this.milestone = prData.milestone ? new Milestone(prData.milestone) : null;
Expand Down

0 comments on commit 1bb0fea

Please sign in to comment.