Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/@graphql-inspector_action-2636-dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-inspector/action': patch
---
dependencies updates:
- Updated dependency [`@actions/github@6.0.0`
↗︎](https://www.npmjs.com/package/@actions/github/v/6.0.0) (from `4.0.0`, in `dependencies`)
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
'example/schemas/schema.js',
'example/rules/custom-rule.js',
'integration_tests/2027/unused-hotels.js',
'__tests__',
],
extends: ['@theguild', '@theguild/eslint-config/json', '@theguild/eslint-config/yml'],
overrides: [
Expand Down
14 changes: 8 additions & 6 deletions packages/action/__tests__/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ describe('Inspector Action', () => {
});

vi.spyOn(github, 'getOctokit').mockReturnValue({
checks: {
create: vi.fn().mockResolvedValue({
data: {
id: '2',
},
}),
rest: {
checks: {
create: vi.fn().mockResolvedValue({
data: {
id: '2',
},
}),
},
},
});
vi.spyOn(github.context, 'repo', 'get').mockImplementation(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/action/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
},
"dependencies": {
"@actions/core": "1.10.1",
"@actions/github": "4.0.0",
"@actions/github": "6.0.0",
"@graphql-inspector/commands": "workspace:*",
"@graphql-inspector/core": "workspace:*",
"dataloader": "2.2.2",
Expand Down
9 changes: 6 additions & 3 deletions packages/action/src/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { OctokitInstance } from './types.js';
import { batch } from './utils.js';

type UpdateCheckRunOptions = Required<
Pick<NonNullable<Parameters<OctokitInstance['checks']['update']>[0]>, 'conclusion' | 'output'>
Pick<
NonNullable<Parameters<OctokitInstance['rest']['checks']['update']>[0]>,
'conclusion' | 'output'
>
>;

export async function updateCheckRun(
Expand All @@ -20,7 +23,7 @@ export async function updateCheckRun(

core.info(`annotations to be sent: ${annotations.length}`);

await octokit.checks.update({
await octokit.rest.checks.update({
check_run_id: checkId,
completed_at: new Date().toISOString(),
status: 'completed',
Expand All @@ -35,7 +38,7 @@ export async function updateCheckRun(
try {
await Promise.all(
batches.map(async chunk => {
await octokit.checks.update({
await octokit.rest.checks.update({
check_run_id: checkId,
...github.context.repo,
output: {
Expand Down
2 changes: 1 addition & 1 deletion packages/action/src/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function fileLoader({
try {
if (result?.repository?.object?.oid && result?.repository?.object?.isTruncated) {
const oid = result?.repository?.object?.oid;
const getBlobResponse = await octokit.git.getBlob({
const getBlobResponse = await octokit.rest.git.getBlob({
owner,
repo,
file_sha: oid,
Expand Down
2 changes: 1 addition & 1 deletion packages/action/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export async function run() {

core.info(`Creating a check named "${checkName}"`);

const check = await octokit.checks.create({
const check = await octokit.rest.checks.create({
owner,
repo,
name: checkName,
Expand Down
114 changes: 92 additions & 22 deletions pnpm-lock.yaml

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

4 changes: 0 additions & 4 deletions tsconfig.build.json

This file was deleted.

52 changes: 2 additions & 50 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,4 @@
{
"compilerOptions": {
"incremental": true,
"baseUrl": ".",
"rootDir": "packages",
"outDir": "dist",
"target": "ES2021",
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["ESNext"],
"importHelpers": true,
"preserveConstEnums": true,
"downlevelIteration": true,
"sourceMap": true,
"declaration": true,
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",

"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"skipLibCheck": true,
"types": ["vitest/globals"],
"paths": {
"@graphql-inspector/core": ["packages/core/src/index.ts"],
"@graphql-inspector/logger": ["packages/logger/src/index.ts"],
"@graphql-inspector/ci": ["packages/ci/src/index.ts"],
"@graphql-inspector/cli": ["packages/cli/src/index.ts"],
"@graphql-inspector/config": ["packages/config/src/index.ts"],
"@graphql-inspector/commands": ["packages/commands/commands/src/index.ts"],
"@graphql-inspector/loaders": ["packages/loaders/loaders/src/index.ts"],
"@graphql-inspector/action": ["packages/action/src/index.ts"],
"@graphql-inspector/code-loader": ["packages/loaders/code/src/index.ts"],
"@graphql-inspector/git-loader": ["packages/loaders/git/src/index.ts"],
"@graphql-inspector/github-loader": ["packages/loaders/github/src/index.ts"],
"@graphql-inspector/graphql-loader": ["packages/loaders/graphql/src/index.ts"],
"@graphql-inspector/json-loader": ["packages/loaders/json/src/index.ts"],
"@graphql-inspector/url-loader": ["packages/loaders/url/src/index.ts"],
"@graphql-inspector/diff-command": ["packages/commands/diff/src/index.ts"],
"@graphql-inspector/docs-command": ["packages/commands/docs/src/index.ts"],
"@graphql-inspector/serve-command": ["packages/commands/serve/src/index.ts"],
"@graphql-inspector/coverage-command": ["packages/commands/coverage/src/index.ts"],
"@graphql-inspector/validate-command": ["packages/commands/validate/src/index.ts"],
"@graphql-inspector/introspect-command": ["packages/commands/introspect/src/index.ts"],
"@graphql-inspector/similar-command": ["packages/commands/similar/src/index.ts"],
"@graphql-inspector/testing": ["packages/testing/src/index.ts"]
}
},
"include": ["packages"],
"exclude": ["**/dist", "**/node_modules/**"]
"extends": "./tsconfig.test.json",
"exclude": ["**/dist", "**/node_modules/**", "**/__tests__", "**/tests"]
}
Loading
Loading