Skip to content

v2 #233

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

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

v2 #233

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0a0b332
refactor: move main
Codex- Oct 5, 2024
d6a98da
refactor: run from new main
Codex- Oct 5, 2024
6019660
refactor: lift some prework to main
Codex- Oct 5, 2024
1d83f75
refactor: rename api gets to fetches
Codex- Oct 5, 2024
4fa54c8
chore: resolve some lint warnings
Codex- Oct 5, 2024
9a524c9
refactor: lift wrapping try/catch to main
Codex- Oct 5, 2024
e6fc07f
refactor: add ts-reset
Codex- Oct 5, 2024
bbff48f
fix: prevent createRequire clashes
Codex- Oct 5, 2024
5ee0821
refactor: start using result types for retryOnError
Codex- Oct 6, 2024
e6b436b
docs: update api doc links
Codex- Oct 6, 2024
5a12d91
chore: add knip and address findings
Codex- Oct 6, 2024
0aaae83
refactor: use result types for flow control
Codex- Oct 26, 2024
e974ae3
refactor: remove passing action config into getWorkflowRunResult
Codex- Oct 26, 2024
d73efce
fix: prevent extra iterations occurring on fetchWorkflowRunActiveJobU…
Codex- Oct 26, 2024
e5d2a7e
fix: job logging indentation on fetchWorkflowRunFailedJobs
Codex- Oct 26, 2024
1361475
test: add logging snapshots to api tests
Codex- Oct 26, 2024
abb62ce
test: cover missing cases for action config parsing and assert logging
Codex- Oct 26, 2024
b8a1704
chore: exclude test mocks from code coverage
Codex- Oct 26, 2024
242f5cd
test: add getWorkflowRunStatusResult tests
Codex- Oct 26, 2024
b91d606
test: fix bug in logging assertions
Codex- Oct 27, 2024
5cee2ef
refactor: handleActionFailure reworked to set failure before logging
Codex- Nov 6, 2024
6f35b7e
refactor: rework some types
Codex- Nov 6, 2024
fe79e8b
refactor: Request users to open issues if they encounter an unhandled…
Codex- Nov 24, 2024
0568eee
refactor: finish handling and testing results for runs
Codex- Nov 24, 2024
ca18e07
refactor: main should fail for non-success conclusions
Codex- Nov 24, 2024
a4a6a86
chore: bump dependencies
Codex- Nov 24, 2024
dc39e95
refactor: Use result type when fetching job URLs
Codex- Mar 11, 2025
9fbf558
chore: update eslint packages and config
Codex- Apr 6, 2025
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@v5
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: jdx/mise-action@v2
- 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
48 changes: 8 additions & 40 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
// @ts-check

import { fixupPluginRules } from "@eslint/compat";
import { FlatCompat } from "@eslint/eslintrc";
import jsEslint from "@eslint/js";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintPluginImportX from "eslint-plugin-import-x";
import * as eslintPluginImportX from "eslint-plugin-import-x";
import * as tsEslint from "typescript-eslint";

const compat = new FlatCompat({
baseDirectory: import.meta.dirname,
recommendedConfig: jsEslint.configs.recommended,
allConfig: jsEslint.configs.all,
});

/* eslint-disable @typescript-eslint/explicit-function-return-type */
/**
* @param {string} name the pugin name
* @param {string} alias the plugin alias
* @returns {import("eslint").ESLint.Plugin}
*/
function legacyPlugin(name, alias = name) {
const plugin = compat.plugins(name)[0]?.plugins?.[alias];

if (!plugin) {
throw new Error(`Unable to resolve plugin ${name} and/or alias ${alias}`);
}

return fixupPluginRules(plugin);
}
/* eslint-enable @typescript-eslint/explicit-function-return-type */

export default tsEslint.config(
jsEslint.configs.recommended,
eslintPluginImportX.flatConfigs.recommended,
Expand All @@ -48,17 +23,14 @@ export default tsEslint.config(
},
{
ignores: [
"**/coverage",
"**/dist",
"**/esbuild.config.mjs",
"**/vitest.config.ts",
"coverage",
"dist",
"esbuild.config.mjs",
"knip.ts",
"vitest.config.ts",
],
},
{
plugins: {
github: legacyPlugin("eslint-plugin-github", "github"), // pending https://github.com/github/eslint-plugin-github/issues/513
import: legacyPlugin("eslint-plugin-import", "import"), // Needed for above
},
rules: {
"@typescript-eslint/await-thenable": "warn",
"@typescript-eslint/explicit-function-return-type": "warn",
Expand All @@ -79,19 +51,15 @@ export default tsEslint.config(
allowNumber: true,
},
],
"github/array-foreach": "error",
"github/no-implicit-buggy-globals": "error",
"github/no-then": "error",
"github/no-dynamic-script-tag": "error",
"import/no-extraneous-dependencies": [
"import-x/no-extraneous-dependencies": [
"error",
{
devDependencies: true,
optionalDependencies: true,
peerDependencies: true,
},
],
"import/order": [
"import-x/order": [
"warn",
{ "newlines-between": "always", alphabetize: { order: "asc" } },
],
Expand Down
11 changes: 11 additions & 0 deletions knip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { KnipConfig } from "knip";

const config: KnipConfig = {
ignore: ["dist/**"],
ignoreDependencies: [
// Required by eslint-plugin-import-x
"eslint-import-resolver-typescript",
],
};

export default config;
28 changes: 12 additions & 16 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 @@ -32,26 +32,22 @@
"@actions/github": "^6.0.0"
},
"devDependencies": {
"@eslint/compat": "^1.2.8",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.25.1",
"@types/eslint__js": "^8.42.3",
"@eslint/js": "^9.26.0",
"@opentf/std": "^0.13.0",
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^20.17.32",
"@typescript-eslint/eslint-plugin": "^8.31.1",
"@typescript-eslint/parser": "^8.31.1",
"@vitest/coverage-v8": "^3.1.2",
"@vitest/coverage-v8": "^3.1.3",
"chalk": "^5.4.1",
"changelogithub": "^13.13.0",
"esbuild": "^0.25.3",
"eslint": "^9.25.1",
"eslint": "^9.26.0",
"eslint-config-prettier": "^10.1.2",
"eslint-import-resolver-typescript": "^3.10.1",
"eslint-plugin-github": "^5.1.8",
"eslint-plugin-import": "^2.31.0",
"eslint-import-resolver-typescript": "^4.3.4",
"eslint-plugin-import-x": "^4.11.0",
"knip": "^5.53.0",
"prettier": "3.5.3",
"typescript": "^5.8.3",
"typescript-eslint": "^8.31.1",
"vitest": "^3.1.2"
"typescript-eslint": "^8.32.0",
"vitest": "^3.1.3"
}
}
Loading