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 10a499a
Show file tree
Hide file tree
Showing 15 changed files with 210 additions and 8 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.

12 changes: 10 additions & 2 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.

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.

14 changes: 14 additions & 0 deletions dist/milestone.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/milestone.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: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@
"typescript": "^5.2.2",
"vitest": "^0.34.6"
}
}
}
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
2 changes: 1 addition & 1 deletion src/milestone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class Milestone {
this.description = data.description;
this.state = data.state;

this.regex = new RegExp(`^${this.title}\S*$`);
this.regex = new RegExp(`^${this.title}\\S*$`);
}

isCompliant(tag: string): boolean {
Expand Down
9 changes: 7 additions & 2 deletions src/pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,20 @@ export class PullRequest {
}

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

// warning(`"${JSON.stringify(prDataUnsafe)}"`);

const prData = pullRequestDataSchema.parse(prDataUnsafe);

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

0 comments on commit 10a499a

Please sign in to comment.