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 31 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
31 commits
Select commit Hold shift + click to select a range
8d8b0e5
refactor: move main
Codex- Oct 5, 2024
68f80cd
refactor: run from new main
Codex- Oct 5, 2024
4e06560
refactor: lift some prework to main
Codex- Oct 5, 2024
5427124
refactor: rename api gets to fetches
Codex- Oct 5, 2024
715ac66
chore: resolve some lint warnings
Codex- Oct 5, 2024
3f1b8c3
refactor: lift wrapping try/catch to main
Codex- Oct 5, 2024
7facab1
refactor: add ts-reset
Codex- Oct 5, 2024
cc95baa
fix: prevent createRequire clashes
Codex- Oct 5, 2024
2a7f92f
refactor: start using result types for retryOnError
Codex- Oct 6, 2024
8ef2283
docs: update api doc links
Codex- Oct 6, 2024
7e4cf9b
chore: add knip and address findings
Codex- Oct 6, 2024
ffa4a91
refactor: use result types for flow control
Codex- Oct 26, 2024
cedbe1d
refactor: remove passing action config into getWorkflowRunResult
Codex- Oct 26, 2024
4b68056
fix: prevent extra iterations occurring on fetchWorkflowRunActiveJobU…
Codex- Oct 26, 2024
ab54303
fix: job logging indentation on fetchWorkflowRunFailedJobs
Codex- Oct 26, 2024
09930c1
test: add logging snapshots to api tests
Codex- Oct 26, 2024
1340aa3
test: cover missing cases for action config parsing and assert logging
Codex- Oct 26, 2024
acd8272
chore: exclude test mocks from code coverage
Codex- Oct 26, 2024
b122bcd
test: add getWorkflowRunStatusResult tests
Codex- Oct 26, 2024
6782262
test: fix bug in logging assertions
Codex- Oct 27, 2024
6dbeabb
refactor: handleActionFailure reworked to set failure before logging
Codex- Nov 6, 2024
0448f1b
refactor: rework some types
Codex- Nov 6, 2024
2bf5aac
refactor: Request users to open issues if they encounter an unhandled…
Codex- Nov 24, 2024
18cd304
refactor: finish handling and testing results for runs
Codex- Nov 24, 2024
6e8b914
refactor: main should fail for non-success conclusions
Codex- Nov 24, 2024
77a403c
chore: bump dependencies
Codex- Nov 24, 2024
e76737d
refactor: Use result type when fetching job URLs
Codex- Mar 11, 2025
0f1cc46
chore: update eslint packages and config
Codex- Apr 6, 2025
01ca86b
chore: bump dependencies
Codex- Jun 29, 2025
7b0ca07
test: fix incorrect mock
Codex- Jun 29, 2025
ba7eb88
prog
Codex- Jun 29, 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;
36 changes: 17 additions & 19 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,24 @@
"@actions/github": "^6.0.1"
},
"devDependencies": {
"@eslint/compat": "^1.2.9",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.28.0",
"@types/eslint__js": "^8.42.3",
"@eslint/js": "^9.30.0",
"@opentf/std": "^0.13.0",
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^20.17.57",
"@typescript-eslint/eslint-plugin": "^8.33.1",
"@typescript-eslint/parser": "^8.33.1",
"@vitest/coverage-v8": "^3.2.1",
"@vitest/coverage-v8": "^3.2.4",
"chalk": "^5.4.1",
"changelogithub": "^13.15.0",
"changelogithub": "^13.16.0",
"esbuild": "^0.25.5",
"eslint": "^9.28.0",
"eslint": "^9.30.0",
"eslint-config-prettier": "^10.1.5",
"eslint-import-resolver-typescript": "^4.4.2",
"eslint-plugin-github": "^5.1.8",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-import-x": "^4.15.0",
"prettier": "3.5.3",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-github": "^6.0.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-import-x": "^4.16.1",
"knip": "^5.61.3",
"prettier": "3.6.2",
"typescript": "^5.8.3",
"typescript-eslint": "^8.33.1",
"vitest": "^3.2.1"
"typescript-eslint": "^8.35.0",
"vitest": "^3.2.4"
}
}
Loading
Loading