Skip to content
Draft

v2 #233

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
42fc03d
refactor: move main
Codex- Oct 5, 2024
175e8a3
refactor: run from new main
Codex- Oct 5, 2024
43d601c
refactor: lift some prework to main
Codex- Oct 5, 2024
035f884
refactor: rename api gets to fetches
Codex- Oct 5, 2024
1c62ce0
chore: resolve some lint warnings
Codex- Oct 5, 2024
119f3c4
refactor: lift wrapping try/catch to main
Codex- Oct 5, 2024
a884307
refactor: add ts-reset
Codex- Oct 5, 2024
171d441
fix: prevent createRequire clashes
Codex- Oct 5, 2024
d061cc4
refactor: start using result types for retryOnError
Codex- Oct 6, 2024
d65fd39
docs: update api doc links
Codex- Oct 6, 2024
e89630e
chore: add knip and address findings
Codex- Oct 6, 2024
e8dbbbf
refactor: use result types for flow control
Codex- Oct 26, 2024
71da7c2
refactor: remove passing action config into getWorkflowRunResult
Codex- Oct 26, 2024
4272509
fix: prevent extra iterations occurring on fetchWorkflowRunActiveJobU…
Codex- Oct 26, 2024
1cb8cf3
fix: job logging indentation on fetchWorkflowRunFailedJobs
Codex- Oct 26, 2024
f0c4a51
test: add logging snapshots to api tests
Codex- Oct 26, 2024
eefadb5
test: cover missing cases for action config parsing and assert logging
Codex- Oct 26, 2024
226657f
chore: exclude test mocks from code coverage
Codex- Oct 26, 2024
2e41f9f
test: add getWorkflowRunStatusResult tests
Codex- Oct 26, 2024
33f6580
test: fix bug in logging assertions
Codex- Oct 27, 2024
bfa5205
refactor: handleActionFailure reworked to set failure before logging
Codex- Nov 6, 2024
3494049
refactor: rework some types
Codex- Nov 6, 2024
c65e664
refactor: Request users to open issues if they encounter an unhandled…
Codex- Nov 24, 2024
04eb99d
refactor: finish handling and testing results for runs
Codex- Nov 24, 2024
16baac1
refactor: main should fail for non-success conclusions
Codex- Nov 24, 2024
3c116e3
chore: bump dependencies
Codex- Nov 24, 2024
d74ab9c
refactor: Use result type when fetching job URLs
Codex- Mar 11, 2025
e2c3ab4
chore: update eslint packages and config
Codex- Apr 6, 2025
e66b359
test: fix incorrect mock
Codex- Jun 29, 2025
d09ac14
chore: fix api changes since rebase
Codex- Dec 5, 2025
4d42a4e
feat: upgrade to vitest v4
Codex- Dec 5, 2025
e6719df
progress
Codex- Dec 5, 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;
33 changes: 15 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
"license": "MIT",
"type": "module",
"scripts": {
"build": "pnpm run build:types && pnpm run build:bundle",
"build": "pnpm run check:types && pnpm run build:bundle",
"build:bundle": "node ./esbuild.config.mjs",
"build:types": "tsc",
"format:check": "prettier --check **/*.ts",
"check:types": "tsc",
"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,27 +32,24 @@
"@actions/github": "^6.0.1"
},
"devDependencies": {
"@eslint/compat": "^1.4.1",
"@eslint/eslintrc": "^3.3.3",
"@eslint/js": "^9.39.1",
"@octokit/types": "^16.0.0",
"@types/eslint__js": "^8.42.3",
"@opentf/std": "^0.13.0",
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^20.19.25",
"@typescript-eslint/eslint-plugin": "^8.48.0",
"@typescript-eslint/parser": "^8.48.0",
"@vitest/coverage-v8": "^3.2.4",
"@typescript-eslint/parser": "^8.48.1",
"@vitest/coverage-v8": "4.0.15",
"chalk": "^5.6.2",
"changelogithub": "^13.16.1",
"esbuild": "^0.27.0",
"changelogithub": "^14.0.0",
"esbuild": "^0.27.1",
"eslint": "^9.39.1",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-github": "^5.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-import-x": "^4.16.1",
"prettier": "3.7.3",
"knip": "5.71.0",
"prettier": "3.7.4",
"typescript": "^5.9.3",
"typescript-eslint": "^8.48.0",
"vitest": "^3.2.4"
"typescript-eslint": "^8.48.1",
"vitest": "4.0.15"
}
}
Loading
Loading