Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2 #233

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft

v2 #233

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
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,16 @@ jobs:
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
knip-report:
if: ${{ github.event_name == 'pull_request' }}
needs: [build]
runs-on: ubuntu-latest
permissions:
checks: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: asdf-vm/actions/install@v3
- run: pnpm i
- uses: codex-/knip-reporter@v2
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
dist
lib
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ The permissions required for this action to function correctly are:

For the sake of transparency please note that this action uses the following API calls:

- [Get a workflow run](https://docs.github.com/en/rest/reference/actions#get-a-workflow-run)
- [Get a workflow run](https://docs.github.com/en/rest/actions/workflow-runs#get-a-workflow-run)
- GET `/repos/{owner}/{repo}/actions/runs/{run_id}`
- Permissions:
- `repo`
- `actions:read`
- [List jobs for a workflow run](https://docs.github.com/en/rest/reference/actions#list-jobs-for-a-workflow-run)
- [List jobs for a workflow run](https://docs.github.com/en/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run)
- GET `/repos/{owner}/{repo}/actions/runs/{run_id}/jobs`
- Permissions:
- `repo`
Expand Down
4 changes: 2 additions & 2 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import { analyzeMetafile, build } from "esbuild";
// Ensure require is properly defined: https://github.com/evanw/esbuild/issues/1921
banner: {
js:
"import { createRequire } from 'module';\n" +
"const require = createRequire(import.meta.url);",
"import { createRequire as __await_remote_run_cr } from 'node:module';\n" +
"const require = __await_remote_run_cr(import.meta.url);",
},
});

Expand Down
9 changes: 5 additions & 4 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ export default tsEslint.config(
},
{
ignores: [
"**/coverage",
"**/dist",
"**/esbuild.config.mjs",
"**/vitest.config.ts",
"coverage",
"dist",
"esbuild.config.mjs",
"knip.ts",
"vitest.config.ts",
],
},
{
Expand Down
15 changes: 15 additions & 0 deletions knip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import type { KnipConfig } from "knip";

const config: KnipConfig = {
ignore: ["dist/**"],
ignoreDependencies: [
// Used in eslint.config.mjs
"eslint-plugin-github",
"eslint-plugin-import",
// Required by eslint-plugin-import-x
"@typescript-eslint/parser",
"eslint-import-resolver-typescript",
],
};

export default config;
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"build": "pnpm run build:types && pnpm run build:bundle",
"build:bundle": "node ./esbuild.config.mjs",
"build:types": "tsc",
"format:check": "prettier --check **/*.ts",
"format:check": "prettier --check **/*.*",
"format": "pnpm run format:check --write",
"lint": "eslint",
"lint:fix": "pnpm run lint --fix",
"release": "release-it",
"test": "vitest",
"test:coverage": "vitest --coverage"
"test:coverage": "vitest --coverage",
"knip": "knip"
},
"repository": {
"type": "git",
Expand All @@ -35,9 +35,10 @@
"@eslint/compat": "^1.2.0",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.12.0",
"@opentf/std": "^0.13.0",
"@total-typescript/ts-reset": "^0.6.1",
"@types/eslint__js": "^8.42.3",
"@types/node": "^20.16.10",
"@typescript-eslint/eslint-plugin": "^8.8.0",
"@typescript-eslint/parser": "^8.8.0",
"@vitest/coverage-v8": "^2.1.1",
"chalk": "^5.3.0",
Expand All @@ -49,6 +50,7 @@
"eslint-plugin-github": "^5.0.2",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-import-x": "^4.3.1",
"knip": "^5.32.0",
"prettier": "3.3.3",
"typescript": "^5.6.2",
"typescript-eslint": "^8.8.0",
Expand Down
Loading
Loading