diff --git a/.github/workflows/eslint-miner.lock.yml b/.github/workflows/eslint-miner.lock.yml index fde020445af..d3e09764046 100644 --- a/.github/workflows/eslint-miner.lock.yml +++ b/.github/workflows/eslint-miner.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"4a3cb0649f75288296ad56fd104fb26719b0ea7c524792916326f741e7c34f3f","body_hash":"70ab12e53838154da500a35e55a1795735b7d2622686daf18660f77815fd9c63","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.65","copilot-sdk":"1.0.4"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"050548fa851cf1bb08cdedbfd68ba6f2ae95389a060e55f9632b2e67cc0dfbde","body_hash":"1f21279532a987786bfb19595cb2a3e5773d2cb07b1b00399074c730a28589c0","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.65","copilot-sdk":"1.0.4"}} # gh-aw-manifest: {"version":1,"secrets":["GH_AW_CI_TRIGGER_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/cache/save","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.11","digest":"sha256:979723c628182da7729333f2208bb249fd25ddee579645cf9a3892d681a929c7","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.11@sha256:979723c628182da7729333f2208bb249fd25ddee579645cf9a3892d681a929c7"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.11","digest":"sha256:807e4831999b44513b0a66e5859d478dc4da7ae74ab1918cec967d513f95bf9d","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.11@sha256:807e4831999b44513b0a66e5859d478dc4da7ae74ab1918cec967d513f95bf9d"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.11"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.11","digest":"sha256:ff27ea0525ad953a6adee28a5fbe9d2e22be47dbec755c15767af4ea3f91df7d","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.11@sha256:ff27ea0525ad953a6adee28a5fbe9d2e22be47dbec755c15767af4ea3f91df7d"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.30","digest":"sha256:35625d1a2269b1238606078c879f59a91cffc4ac33eb54bf39c6418822c1a8be","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.30@sha256:35625d1a2269b1238606078c879f59a91cffc4ac33eb54bf39c6418822c1a8be"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.4.0","digest":"sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036","pinned_image":"ghcr.io/github/github-mcp-server:v1.4.0@sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036"}]} # This file was automatically generated by gh-aw. DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -23,7 +23,7 @@ # # For more information: https://github.github.com/gh-aw/introduction/overview/ # -# Daily workflow that mines JavaScript/TypeScript patterns in actions/setup/js and creates new TypeScript-based ESLint rules in actions/setup/js/eslint-factory +# Daily workflow that mines JavaScript/TypeScript patterns in actions/setup/js and creates new TypeScript-based ESLint rules in eslint-factory # # Secrets used: # - GH_AW_CI_TRIGGER_TOKEN @@ -544,9 +544,9 @@ jobs: mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" mkdir -p /tmp/gh-aw/safeoutputs mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs - cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_aacada4a23561f29_EOF' - {"create_pull_request":{"allowed_files":["actions/setup/js/eslint-factory/**"],"draft":true,"expires":168,"if_no_changes":"warn","labels":["automation","eslint","cookie"],"max":1,"max_patch_files":100,"max_patch_size":4096,"protect_top_level_dot_folders":true,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","DESIGN.md","README.md","CONTRIBUTING.md","CHANGELOG.md","SECURITY.md","CODE_OF_CONDUCT.md","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_files_policy":"fallback-to-issue","reviewers":["copilot"],"title_prefix":"[eslint-miner] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} - GH_AW_SAFE_OUTPUTS_CONFIG_aacada4a23561f29_EOF + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_596ce38bae0c4069_EOF' + {"create_pull_request":{"allowed_files":["eslint-factory/**"],"draft":true,"expires":168,"if_no_changes":"warn","labels":["automation","eslint","cookie"],"max":1,"max_patch_files":100,"max_patch_size":4096,"protect_top_level_dot_folders":true,"protected_files":["package.json","bun.lockb","bunfig.toml","deno.json","deno.jsonc","deno.lock","global.json","NuGet.Config","Directory.Packages.props","mix.exs","mix.lock","go.mod","go.sum","stack.yaml","stack.yaml.lock","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","package-lock.json","yarn.lock","pnpm-lock.yaml","npm-shrinkwrap.json","requirements.txt","Pipfile","Pipfile.lock","pyproject.toml","setup.py","setup.cfg","Gemfile","Gemfile.lock","uv.lock","CODEOWNERS","DESIGN.md","README.md","CONTRIBUTING.md","CHANGELOG.md","SECURITY.md","CODE_OF_CONDUCT.md","AGENTS.md","CLAUDE.md","GEMINI.md"],"protected_files_policy":"fallback-to-issue","reviewers":["copilot"],"title_prefix":"[eslint-miner] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} + GH_AW_SAFE_OUTPUTS_CONFIG_596ce38bae0c4069_EOF - name: Generate Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | @@ -1412,7 +1412,7 @@ jobs: uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 env: WORKFLOW_NAME: "ESLint Miner" - WORKFLOW_DESCRIPTION: "Daily workflow that mines JavaScript/TypeScript patterns in actions/setup/js and creates new TypeScript-based ESLint rules in actions/setup/js/eslint-factory" + WORKFLOW_DESCRIPTION: "Daily workflow that mines JavaScript/TypeScript patterns in actions/setup/js and creates new TypeScript-based ESLint rules in eslint-factory" HAS_PATCH: ${{ needs.agent.outputs.has_patch }} with: script: | @@ -1672,7 +1672,7 @@ jobs: GH_AW_ALLOWED_DOMAINS: "api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.npms.io,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,bun.sh,cdn.jsdelivr.net,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,deb.nodesource.com,deno.land,esm.sh,get.pnpm.io,github.com,googleapis.deno.dev,googlechromelabs.github.io,host.docker.internal,json-schema.org,json.schemastore.org,jsr.io,keyserver.ubuntu.com,nodejs.org,npm.pkg.github.com,npmjs.com,npmjs.org,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,ppa.launchpad.net,raw.githubusercontent.com,registry.bower.io,registry.npmjs.com,registry.npmjs.org,registry.yarnpkg.com,repo.yarnpkg.com,s.symcb.com,s.symcd.com,security.ubuntu.com,skimdb.npmjs.com,storage.googleapis.com,telemetry.enterprise.githubcopilot.com,telemetry.vercel.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,www.googleapis.com,www.npmjs.com,www.npmjs.org,yarnpkg.com" GITHUB_SERVER_URL: ${{ github.server_url }} GITHUB_API_URL: ${{ github.api_url }} - GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"allowed_files\":[\"actions/setup/js/eslint-factory/**\"],\"draft\":true,\"expires\":168,\"if_no_changes\":\"warn\",\"labels\":[\"automation\",\"eslint\",\"cookie\"],\"max\":1,\"max_patch_files\":100,\"max_patch_size\":4096,\"protect_top_level_dot_folders\":true,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"DESIGN.md\",\"README.md\",\"CONTRIBUTING.md\",\"CHANGELOG.md\",\"SECURITY.md\",\"CODE_OF_CONDUCT.md\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_files_policy\":\"fallback-to-issue\",\"reviewers\":[\"copilot\"],\"title_prefix\":\"[eslint-miner] \"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request\":{\"allowed_files\":[\"eslint-factory/**\"],\"draft\":true,\"expires\":168,\"if_no_changes\":\"warn\",\"labels\":[\"automation\",\"eslint\",\"cookie\"],\"max\":1,\"max_patch_files\":100,\"max_patch_size\":4096,\"protect_top_level_dot_folders\":true,\"protected_files\":[\"package.json\",\"bun.lockb\",\"bunfig.toml\",\"deno.json\",\"deno.jsonc\",\"deno.lock\",\"global.json\",\"NuGet.Config\",\"Directory.Packages.props\",\"mix.exs\",\"mix.lock\",\"go.mod\",\"go.sum\",\"stack.yaml\",\"stack.yaml.lock\",\"pom.xml\",\"build.gradle\",\"build.gradle.kts\",\"settings.gradle\",\"settings.gradle.kts\",\"gradle.properties\",\"package-lock.json\",\"yarn.lock\",\"pnpm-lock.yaml\",\"npm-shrinkwrap.json\",\"requirements.txt\",\"Pipfile\",\"Pipfile.lock\",\"pyproject.toml\",\"setup.py\",\"setup.cfg\",\"Gemfile\",\"Gemfile.lock\",\"uv.lock\",\"CODEOWNERS\",\"DESIGN.md\",\"README.md\",\"CONTRIBUTING.md\",\"CHANGELOG.md\",\"SECURITY.md\",\"CODE_OF_CONDUCT.md\",\"AGENTS.md\",\"CLAUDE.md\",\"GEMINI.md\"],\"protected_files_policy\":\"fallback-to-issue\",\"reviewers\":[\"copilot\"],\"title_prefix\":\"[eslint-miner] \"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{}}" GH_AW_CI_TRIGGER_TOKEN: ${{ secrets.GH_AW_CI_TRIGGER_TOKEN }} with: github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/eslint-miner.md b/.github/workflows/eslint-miner.md index 72c6001daa2..1b7fb42ca0c 100644 --- a/.github/workflows/eslint-miner.md +++ b/.github/workflows/eslint-miner.md @@ -1,6 +1,6 @@ --- name: ESLint Miner -description: Daily workflow that mines JavaScript/TypeScript patterns in actions/setup/js and creates new TypeScript-based ESLint rules in actions/setup/js/eslint-factory +description: Daily workflow that mines JavaScript/TypeScript patterns in actions/setup/js and creates new TypeScript-based ESLint rules in eslint-factory on: schedule: daily workflow_dispatch: @@ -47,7 +47,7 @@ safe-outputs: expires: 7d if-no-changes: warn allowed-files: - - "actions/setup/js/eslint-factory/**" + - "eslint-factory/**" protected-files: fallback-to-issue noop: timeout-minutes: 120 @@ -76,14 +76,14 @@ Out of scope: 1. Mine issues/discussions from the last 14 days for recurring JavaScript/TypeScript failures in `actions/setup/js`. 2. Scan `actions/setup/js` for recurring patterns that should be enforced automatically. -3. Read existing rules in `actions/setup/js/eslint-factory/src/rules`. +3. Read existing rules in `eslint-factory/src/rules`. 4. Choose one net-new rule idea with low false-positive risk. -5. Implement the rule in TypeScript under `actions/setup/js/eslint-factory/src/rules` and register it in `src/index.ts`. -6. Update `actions/setup/js/eslint-factory/eslint.config.cjs` only if needed to enable the new rule. +5. Implement the rule in TypeScript under `eslint-factory/src/rules` and register it in `src/index.ts`. +6. Update `eslint-factory/eslint.config.cjs` only if needed to enable the new rule. 7. Validate with: - - `cd actions/setup/js/eslint-factory && npm install` - - `cd actions/setup/js/eslint-factory && npm run build` - - `cd actions/setup/js/eslint-factory && npm run lint:setup-js` + - `cd eslint-factory && npm install` + - `cd eslint-factory && npm run build` + - `cd eslint-factory && npm run lint:setup-js` 8. Open one draft PR with evidence and rationale. ## Rule quality bar @@ -92,7 +92,7 @@ Out of scope: - Must include a clear diagnostic message. - Must target behavior observed in `actions/setup/js`. - Must avoid stylistic-only opinions. -- Must not require changing files outside `actions/setup/js` and `actions/setup/js/eslint-factory`. +- Must not require changing files outside `actions/setup/js` and `eslint-factory`. ## Final action diff --git a/.github/workflows/eslint-monster.lock.yml b/.github/workflows/eslint-monster.lock.yml index 8d5595887bc..e8f0e4e70f3 100644 --- a/.github/workflows/eslint-monster.lock.yml +++ b/.github/workflows/eslint-monster.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"e7564d8b6fe388f1fc3797cf6af7ab0eb382856a93f801e2ac0b8ae6b12331c4","body_hash":"cb82d1e610cf30035cdcc2b2756d3c581cb4f252ec0f3e42a419640c296a7bf1","strict":true,"agent_id":"pi","agent_model":"copilot/gpt-5.4","engine_versions":{"pi":"0.80.2"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"af67920d3c9c14e9817213efebc122d3734f11b30fd24e6a88d5b4381e2b63a8","body_hash":"cb82d1e610cf30035cdcc2b2756d3c581cb4f252ec0f3e42a419640c296a7bf1","strict":true,"agent_id":"pi","agent_model":"copilot/gpt-5.4","engine_versions":{"pi":"0.80.2"}} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_AGENT_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_GRAFANA_AUTHORIZATION","GH_AW_OTEL_GRAFANA_ENDPOINT","GH_AW_OTEL_SENTRY_AUTHORIZATION","GH_AW_OTEL_SENTRY_ENDPOINT","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/cache/save","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.11","digest":"sha256:979723c628182da7729333f2208bb249fd25ddee579645cf9a3892d681a929c7","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.11@sha256:979723c628182da7729333f2208bb249fd25ddee579645cf9a3892d681a929c7"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.11","digest":"sha256:807e4831999b44513b0a66e5859d478dc4da7ae74ab1918cec967d513f95bf9d","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.11@sha256:807e4831999b44513b0a66e5859d478dc4da7ae74ab1918cec967d513f95bf9d"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.11"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.11","digest":"sha256:ff27ea0525ad953a6adee28a5fbe9d2e22be47dbec755c15767af4ea3f91df7d","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.11@sha256:ff27ea0525ad953a6adee28a5fbe9d2e22be47dbec755c15767af4ea3f91df7d"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.30","digest":"sha256:35625d1a2269b1238606078c879f59a91cffc4ac33eb54bf39c6418822c1a8be","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.30@sha256:35625d1a2269b1238606078c879f59a91cffc4ac33eb54bf39c6418822c1a8be"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.4.0","digest":"sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036","pinned_image":"ghcr.io/github/github-mcp-server:v1.4.0@sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036"}]} # This file was automatically generated by gh-aw. DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -471,7 +471,7 @@ jobs: GH_TOKEN: ${{ github.token }} - id: eslint_scan name: Run ESLint factory pre-check - run: "set -euo pipefail\nmkdir -p /tmp/gh-aw/agent\nrm -f /tmp/gh-aw/agent/lint-clean.flag\nREPO_ROOT=\"$(pwd)\"\n\ncd actions/setup/js/eslint-factory\nnpm ci > /tmp/gh-aw/agent/eslint-factory.log 2>&1\n\nif npm run lint:setup-js >> /tmp/gh-aw/agent/eslint-factory.log 2>&1; then\n : > /tmp/gh-aw/agent/eslint-diagnostics.txt\n : > /tmp/gh-aw/agent/skill-index.txt\n touch /tmp/gh-aw/agent/lint-clean.flag\n exit 0\nfi\n\ngrep -E '^[^:]+:[0-9]+:[0-9]+:' /tmp/gh-aw/agent/eslint-factory.log > /tmp/gh-aw/agent/eslint-diagnostics.txt || true\ndiag_count=$(wc -l < /tmp/gh-aw/agent/eslint-diagnostics.txt | tr -d ' ')\nif [ \"${diag_count}\" -eq 0 ]; then\n grep -E '^[[:space:]]*[^[:space:]].*$' /tmp/gh-aw/agent/eslint-factory.log | head -n 80 > /tmp/gh-aw/agent/eslint-diagnostics.txt || true\nfi\n\nfind \"${REPO_ROOT}/.github/skills\" -maxdepth 6 -name 'SKILL.md' | sort > /tmp/gh-aw/agent/skill-index.txt\n" + run: "set -euo pipefail\nmkdir -p /tmp/gh-aw/agent\nrm -f /tmp/gh-aw/agent/lint-clean.flag\nREPO_ROOT=\"$(pwd)\"\n\ncd eslint-factory\nnpm ci > /tmp/gh-aw/agent/eslint-factory.log 2>&1\n\nif npm run lint:setup-js >> /tmp/gh-aw/agent/eslint-factory.log 2>&1; then\n : > /tmp/gh-aw/agent/eslint-diagnostics.txt\n : > /tmp/gh-aw/agent/skill-index.txt\n touch /tmp/gh-aw/agent/lint-clean.flag\n exit 0\nfi\n\ngrep -E '^[^:]+:[0-9]+:[0-9]+:' /tmp/gh-aw/agent/eslint-factory.log > /tmp/gh-aw/agent/eslint-diagnostics.txt || true\ndiag_count=$(wc -l < /tmp/gh-aw/agent/eslint-diagnostics.txt | tr -d ' ')\nif [ \"${diag_count}\" -eq 0 ]; then\n grep -E '^[[:space:]]*[^[:space:]].*$' /tmp/gh-aw/agent/eslint-factory.log | head -n 80 > /tmp/gh-aw/agent/eslint-diagnostics.txt || true\nfi\n\nfind \"${REPO_ROOT}/.github/skills\" -maxdepth 6 -name 'SKILL.md' | sort > /tmp/gh-aw/agent/skill-index.txt\n" - name: Configure Git credentials env: diff --git a/.github/workflows/eslint-monster.md b/.github/workflows/eslint-monster.md index 2a03df41cc7..8bd961520fb 100644 --- a/.github/workflows/eslint-monster.md +++ b/.github/workflows/eslint-monster.md @@ -35,7 +35,7 @@ steps: rm -f /tmp/gh-aw/agent/lint-clean.flag REPO_ROOT="$(pwd)" - cd actions/setup/js/eslint-factory + cd eslint-factory npm ci > /tmp/gh-aw/agent/eslint-factory.log 2>&1 if npm run lint:setup-js >> /tmp/gh-aw/agent/eslint-factory.log 2>&1; then diff --git a/.github/workflows/eslint-refiner.lock.yml b/.github/workflows/eslint-refiner.lock.yml index c307def3df1..05ce9acbfdd 100644 --- a/.github/workflows/eslint-refiner.lock.yml +++ b/.github/workflows/eslint-refiner.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"ceb8316b332a2746ac5481992cf1a374bd72146f698996b497db26ccdb841ea0","body_hash":"1e52dd07646f4a4c91ae912fddbb2bdb787ca22e595b576f0b1dc21589b35624","strict":true,"agent_id":"claude","engine_versions":{"claude":"2.1.195"}} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"fcff8210042ec18ae38fa8c9f99f15d5e6bc034abc8e5decc9c96d87de1eb594","body_hash":"d852b462ace349449873866e1c341baefbb0567380c56c75b099f22509ecb75c","strict":true,"agent_id":"claude","engine_versions":{"claude":"2.1.195"}} # gh-aw-manifest: {"version":1,"secrets":["ANTHROPIC_API_KEY","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_GRAFANA_AUTHORIZATION","GH_AW_OTEL_GRAFANA_ENDPOINT","GH_AW_OTEL_SENTRY_AUTHORIZATION","GH_AW_OTEL_SENTRY_ENDPOINT","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/cache/save","sha":"27d5ce7f107fe9357f9df03efb73ab90386fccae","version":"v5.0.5"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.11","digest":"sha256:979723c628182da7729333f2208bb249fd25ddee579645cf9a3892d681a929c7","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.27.11@sha256:979723c628182da7729333f2208bb249fd25ddee579645cf9a3892d681a929c7"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.11","digest":"sha256:807e4831999b44513b0a66e5859d478dc4da7ae74ab1918cec967d513f95bf9d","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.11@sha256:807e4831999b44513b0a66e5859d478dc4da7ae74ab1918cec967d513f95bf9d"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.11"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.11","digest":"sha256:ff27ea0525ad953a6adee28a5fbe9d2e22be47dbec755c15767af4ea3f91df7d","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.27.11@sha256:ff27ea0525ad953a6adee28a5fbe9d2e22be47dbec755c15767af4ea3f91df7d"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.30","digest":"sha256:35625d1a2269b1238606078c879f59a91cffc4ac33eb54bf39c6418822c1a8be","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.30@sha256:35625d1a2269b1238606078c879f59a91cffc4ac33eb54bf39c6418822c1a8be"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.4.0","digest":"sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036","pinned_image":"ghcr.io/github/github-mcp-server:v1.4.0@sha256:2afb26356481d1a350e14544a6e160f7f7ec1561a1ea309b823665abf0309036"}]} # This file was automatically generated by gh-aw. DO NOT EDIT. To debug this workflow, load the skill at https://github.com/github/gh-aw/blob/main/debug.md # @@ -839,12 +839,12 @@ jobs: - name: Execute Claude Code CLI id: agentic_execution # Allowed tools (sorted): - # - Bash(cat actions/setup/js/eslint-factory/package.json) + # - Bash(cat eslint-factory/package.json) # - Bash(cat) # - Bash(date) # - Bash(echo) # - Bash(find actions/setup/js -name "*.cjs" -type f) - # - Bash(find actions/setup/js/eslint-factory/src/rules -name "*.ts" -type f) + # - Bash(find eslint-factory/src/rules -name "*.ts" -type f) # - Bash(gh:*) # - Bash(grep) # - Bash(head) @@ -955,7 +955,7 @@ jobs: fi # shellcheck disable=SC1003,SC2086 sudo -E awf --config "${RUNNER_TEMP}/gh-aw/awf-config.json" --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" ${GH_AW_TOOL_CACHE_MOUNT:+--mount "$GH_AW_TOOL_CACHE_MOUNT"} ${GH_AW_DOCKER_HOST:+--docker-host "$GH_AW_DOCKER_HOST"} ${GH_AW_DOCKER_HOST_PATH_PREFIX_ARGS} --tty --env-all --exclude-env ANTHROPIC_API_KEY --exclude-env GH_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --allow-host-ports 80,443,8080 --skip-pull --difc-proxy-host host.docker.internal:18443 --difc-proxy-ca-cert /tmp/gh-aw/difc-proxy-tls/ca.crt \ - -- /bin/bash -c 'set +o histexpand; export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && : "${RUNNER_TOOL_CACHE:?RUNNER_TOOL_CACHE must be set}"; GH_AW_TOOL_CACHE="$RUNNER_TOOL_CACHE"; export PATH="$(find "$GH_AW_TOOL_CACHE" -maxdepth 5 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || true)"; fi; if [ -z "$GH_AW_NODE_EXEC" ]; then echo "node runtime missing on this runner — check runtimes.node in workflow YAML" >&2; exit 127; fi; GH_AW_NPM_GLOBAL_ROOT="$(npm root -g 2>/dev/null || true)"; if [ -n "$GH_AW_NPM_GLOBAL_ROOT" ]; then export NODE_PATH="${GH_AW_NPM_GLOBAL_ROOT}${NODE_PATH:+:${NODE_PATH}}"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/claude_harness.cjs claude --print --no-chrome --allowed-tools '\''Bash(cat actions/setup/js/eslint-factory/package.json),Bash(cat),Bash(date),Bash(echo),Bash(find actions/setup/js -name "*.cjs" -type f),Bash(find actions/setup/js/eslint-factory/src/rules -name "*.ts" -type f),Bash(gh:*),Bash(grep),Bash(head),Bash(ls),Bash(printf),Bash(pwd),Bash(safeoutputs:*),Bash(sort),Bash(tail),Bash(uniq),Bash(wc -l),Bash(wc),Bash(yq),BashOutput,Edit,Edit(/tmp/*),Edit(/tmp/gh-aw/agent/*),ExitPlanMode,Glob,Grep,KillBash,LS,MultiEdit,MultiEdit(/tmp/*),MultiEdit(/tmp/gh-aw/agent/*),NotebookEdit,NotebookRead,Read,Read(/tmp/*),Read(/tmp/gh-aw/agent/*),Task,TodoWrite,Write,Write(/tmp/*),Write(/tmp/gh-aw/agent/*),mcp__github__actions_get,mcp__github__actions_list,mcp__github__get_code_scanning_alert,mcp__github__get_commit,mcp__github__get_dependabot_alert,mcp__github__get_discussion,mcp__github__get_discussion_comments,mcp__github__get_file_contents,mcp__github__get_job_logs,mcp__github__get_label,mcp__github__get_latest_release,mcp__github__get_me,mcp__github__get_notification_details,mcp__github__get_pull_request,mcp__github__get_pull_request_comments,mcp__github__get_pull_request_diff,mcp__github__get_pull_request_files,mcp__github__get_pull_request_review_comments,mcp__github__get_pull_request_reviews,mcp__github__get_pull_request_status,mcp__github__get_release_by_tag,mcp__github__get_secret_scanning_alert,mcp__github__get_tag,mcp__github__issue_read,mcp__github__list_branches,mcp__github__list_code_scanning_alerts,mcp__github__list_commits,mcp__github__list_dependabot_alerts,mcp__github__list_discussion_categories,mcp__github__list_discussions,mcp__github__list_issue_types,mcp__github__list_issues,mcp__github__list_label,mcp__github__list_notifications,mcp__github__list_pull_requests,mcp__github__list_releases,mcp__github__list_secret_scanning_alerts,mcp__github__list_starred_repositories,mcp__github__list_tags,mcp__github__pull_request_read,mcp__github__search_code,mcp__github__search_issues,mcp__github__search_orgs,mcp__github__search_pull_requests,mcp__github__search_repositories,mcp__github__search_users,mcp__safeoutputs'\'' --debug-file /tmp/gh-aw/agent-stdio.log --verbose --permission-mode acceptEdits --output-format stream-json --mcp-config "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt${GH_AW_MODEL_AGENT_CLAUDE:+ --model "$GH_AW_MODEL_AGENT_CLAUDE"}' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log + -- /bin/bash -c 'set +o histexpand; export PATH="${RUNNER_TEMP}/gh-aw/mcp-cli/bin:$PATH" && : "${RUNNER_TOOL_CACHE:?RUNNER_TOOL_CACHE must be set}"; GH_AW_TOOL_CACHE="$RUNNER_TOOL_CACHE"; export PATH="$(find "$GH_AW_TOOL_CACHE" -maxdepth 5 -type d -name bin 2>/dev/null | tr '\''\n'\'' '\'':'\'')$PATH"; [ -n "$GOROOT" ] && export PATH="$GOROOT/bin:$PATH" || true && GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || true)"; fi; if [ -z "$GH_AW_NODE_EXEC" ]; then echo "node runtime missing on this runner — check runtimes.node in workflow YAML" >&2; exit 127; fi; GH_AW_NPM_GLOBAL_ROOT="$(npm root -g 2>/dev/null || true)"; if [ -n "$GH_AW_NPM_GLOBAL_ROOT" ]; then export NODE_PATH="${GH_AW_NPM_GLOBAL_ROOT}${NODE_PATH:+:${NODE_PATH}}"; fi; "$GH_AW_NODE_EXEC" ${RUNNER_TEMP}/gh-aw/actions/claude_harness.cjs claude --print --no-chrome --allowed-tools '\''Bash(cat eslint-factory/package.json),Bash(cat),Bash(date),Bash(echo),Bash(find actions/setup/js -name "*.cjs" -type f),Bash(find eslint-factory/src/rules -name "*.ts" -type f),Bash(gh:*),Bash(grep),Bash(head),Bash(ls),Bash(printf),Bash(pwd),Bash(safeoutputs:*),Bash(sort),Bash(tail),Bash(uniq),Bash(wc -l),Bash(wc),Bash(yq),BashOutput,Edit,Edit(/tmp/*),Edit(/tmp/gh-aw/agent/*),ExitPlanMode,Glob,Grep,KillBash,LS,MultiEdit,MultiEdit(/tmp/*),MultiEdit(/tmp/gh-aw/agent/*),NotebookEdit,NotebookRead,Read,Read(/tmp/*),Read(/tmp/gh-aw/agent/*),Task,TodoWrite,Write,Write(/tmp/*),Write(/tmp/gh-aw/agent/*),mcp__github__actions_get,mcp__github__actions_list,mcp__github__get_code_scanning_alert,mcp__github__get_commit,mcp__github__get_dependabot_alert,mcp__github__get_discussion,mcp__github__get_discussion_comments,mcp__github__get_file_contents,mcp__github__get_job_logs,mcp__github__get_label,mcp__github__get_latest_release,mcp__github__get_me,mcp__github__get_notification_details,mcp__github__get_pull_request,mcp__github__get_pull_request_comments,mcp__github__get_pull_request_diff,mcp__github__get_pull_request_files,mcp__github__get_pull_request_review_comments,mcp__github__get_pull_request_reviews,mcp__github__get_pull_request_status,mcp__github__get_release_by_tag,mcp__github__get_secret_scanning_alert,mcp__github__get_tag,mcp__github__issue_read,mcp__github__list_branches,mcp__github__list_code_scanning_alerts,mcp__github__list_commits,mcp__github__list_dependabot_alerts,mcp__github__list_discussion_categories,mcp__github__list_discussions,mcp__github__list_issue_types,mcp__github__list_issues,mcp__github__list_label,mcp__github__list_notifications,mcp__github__list_pull_requests,mcp__github__list_releases,mcp__github__list_secret_scanning_alerts,mcp__github__list_starred_repositories,mcp__github__list_tags,mcp__github__pull_request_read,mcp__github__search_code,mcp__github__search_issues,mcp__github__search_orgs,mcp__github__search_pull_requests,mcp__github__search_repositories,mcp__github__search_users,mcp__safeoutputs'\'' --debug-file /tmp/gh-aw/agent-stdio.log --verbose --permission-mode acceptEdits --output-format stream-json --mcp-config "${RUNNER_TEMP}/gh-aw/mcp-config/mcp-servers.json" --prompt-file /tmp/gh-aw/aw-prompts/prompt.txt${GH_AW_MODEL_AGENT_CLAUDE:+ --model "$GH_AW_MODEL_AGENT_CLAUDE"}' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log env: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} BASH_DEFAULT_TIMEOUT_MS: 60000 diff --git a/.github/workflows/eslint-refiner.md b/.github/workflows/eslint-refiner.md index c11d094d33e..f4ef95f9d5c 100644 --- a/.github/workflows/eslint-refiner.md +++ b/.github/workflows/eslint-refiner.md @@ -34,9 +34,9 @@ strict: true timeout-minutes: 45 tools: bash: - - cat actions/setup/js/eslint-factory/package.json + - cat eslint-factory/package.json - find actions/setup/js -name "*.cjs" -type f - - find actions/setup/js/eslint-factory/src/rules -name "*.ts" -type f + - find eslint-factory/src/rules -name "*.ts" -type f - wc -l cli-proxy: true edit: null @@ -55,7 +55,7 @@ tracker-id: eslint-refiner --- # ESLint Refiner -You are **ESLint Refiner**, focused on improving the quality of custom ESLint rules in `actions/setup/js/eslint-factory`. +You are **ESLint Refiner**, focused on improving the quality of custom ESLint rules in `eslint-factory`. ## Mission @@ -72,7 +72,7 @@ Each day: In scope: -- `actions/setup/js/eslint-factory/**` +- `eslint-factory/**` - JavaScript/TypeScript files in `actions/setup/js/**` as rule targets Out of scope: diff --git a/Makefile b/Makefile index acb8d1b95ed..6052f928908 100644 --- a/Makefile +++ b/Makefile @@ -244,13 +244,21 @@ test-impacted-js: build-js echo "Set BASE_REF explicitly, for example: make test-impacted-js BASE_REF=origin/main"; \ exit 1; \ fi; \ - CHANGED_JS_FILES=$$(git diff --name-only --diff-filter=ACMR "$$BASE_COMMIT"..HEAD -- actions/setup/js | grep -E '\.(cjs|js|mjs|ts)$$' || true); \ + CHANGED_JS_FILES=$$(git diff --name-only --diff-filter=ACMR "$$BASE_COMMIT"..HEAD -- actions/setup/js eslint-factory | grep -E '\.(cjs|js|mjs|ts)$$' || true); \ if [ -z "$$CHANGED_JS_FILES" ]; then \ - echo "No changed JavaScript/TypeScript files under actions/setup/js; skipping impacted JS tests."; \ + echo "No changed JavaScript/TypeScript files under actions/setup/js or eslint-factory; skipping impacted JS tests."; \ exit 0; \ fi; \ - echo "Running impacted JavaScript unit tests for changed files: $$CHANGED_JS_FILES"; \ - cd actions/setup/js && printf '%s\n' "$$CHANGED_JS_FILES" | sed 's|^actions/setup/js/||' | tr '\n' '\0' | xargs -0 -r npm run test:js -- --no-file-parallelism --passWithNoTests $(JS_IMPACTED_TEST_EXCLUDES) + CHANGED_SETUP_JS_FILES=$$(printf '%s\n' "$$CHANGED_JS_FILES" | grep '^actions/setup/js/' || true); \ + CHANGED_ESLINT_FACTORY_FILES=$$(printf '%s\n' "$$CHANGED_JS_FILES" | grep '^eslint-factory/' || true); \ + if [ -n "$$CHANGED_SETUP_JS_FILES" ]; then \ + echo "Running impacted JavaScript unit tests in actions/setup/js for changed files: $$CHANGED_SETUP_JS_FILES"; \ + cd actions/setup/js && printf '%s\n' "$$CHANGED_SETUP_JS_FILES" | sed 's|^actions/setup/js/||' | tr '\n' '\0' | xargs -0 -r npm run test:js -- --no-file-parallelism --passWithNoTests $(JS_IMPACTED_TEST_EXCLUDES); \ + fi; \ + if [ -n "$$CHANGED_ESLINT_FACTORY_FILES" ]; then \ + echo "Running eslint-factory tests for changed files: $$CHANGED_ESLINT_FACTORY_FILES"; \ + cd eslint-factory && npm test; \ + fi # Test impacted Go unit tests only (excluding integration tests) .PHONY: test-impacted-go @@ -407,6 +415,7 @@ test-impacted: test-impacted-js test-impacted-go .PHONY: deps-js deps-js: check-node-version cd actions/setup/js && npm ci + cd eslint-factory && npm ci .PHONY: build-js build-js: deps-js @@ -766,11 +775,12 @@ fmt-go: @go fmt ./... @echo "✓ Go code formatted" -# Format JavaScript (.cjs and .js) and JSON files in actions/setup/js directory +# Format JavaScript (.cjs and .js), TypeScript, and JSON files in runtime + eslint-factory directories .PHONY: fmt-cjs fmt-cjs: @echo "→ Formatting JavaScript files..." @cd actions/setup/js && npm run format:cjs --silent >/dev/null 2>&1 + @cd eslint-factory && npx prettier --write '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../.prettierignore --log-level=error 2>&1 @npx prettier --write 'scripts/**/*.js' --ignore-path .prettierignore --log-level=error 2>&1 @echo "✓ JavaScript files formatted" @@ -792,10 +802,11 @@ fmt-check: exit 1; \ fi -# Check JavaScript (.cjs and .js) and JSON file formatting in actions/setup/js directory +# Check JavaScript (.cjs and .js), TypeScript, and JSON file formatting in runtime + eslint-factory directories .PHONY: fmt-check-cjs fmt-check-cjs: cd actions/setup/js && npm run lint:cjs + cd eslint-factory && npx prettier --check '**/*.cjs' '**/*.ts' '**/*.json' --ignore-path ../.prettierignore npx prettier --check 'scripts/**/*.js' --ignore-path .prettierignore # Check JSON file formatting in pkg directory (excluding actions/setup/js, which is handled by npm script) @@ -1107,12 +1118,12 @@ help: @echo " golint-incremental - Run golangci-lint incrementally (only changed files, requires BASE_REF)" @echo " lint - Run linter" @echo " fmt - Format code" - @echo " fmt-cjs - Format JavaScript (.cjs and .js) and JSON files in actions/setup/js" + @echo " fmt-cjs - Format JavaScript/TypeScript/JSON files in actions/setup/js and eslint-factory" @echo " fmt-json - Format JSON files in pkg directory (excluding actions/setup/js)" @echo " fmt-check - Check code formatting" - @echo " fmt-check-cjs - Check JavaScript (.cjs) and JSON file formatting in actions/setup/js" + @echo " fmt-check-cjs - Check JavaScript/TypeScript/JSON formatting in actions/setup/js and eslint-factory" @echo " fmt-check-json - Check JSON file formatting in pkg directory (excluding actions/setup/js)" - @echo " lint-cjs - Lint JavaScript (.cjs) and JSON files in actions/setup/js" + @echo " lint-cjs - Lint JavaScript/TypeScript/JSON formatting in actions/setup/js and eslint-factory" @echo " lint-json - Lint JSON files in pkg directory (excluding actions/setup/js)" @echo " lint-errors - Lint error messages for quality compliance" @echo " validate-otel-contract - Validate the gh-aw OpenTelemetry compatibility contract" diff --git a/actions/setup/js/eslint-factory/README.md b/eslint-factory/README.md similarity index 66% rename from actions/setup/js/eslint-factory/README.md rename to eslint-factory/README.md index 23a57d1911d..e5468641f04 100644 --- a/actions/setup/js/eslint-factory/README.md +++ b/eslint-factory/README.md @@ -11,5 +11,5 @@ This project hosts custom ESLint linters for `/actions/setup/js`. ## Commands - `npm run build` — compile rule sources. -- `npm run lint:setup-js` — build and lint all `../**/*.cjs` files. -- `npm run lint:setup-js:changed` — build and lint top-level `../*.cjs` files. +- `npm run lint:setup-js` — build and lint all `../actions/setup/js/**/*.cjs` files. +- `npm run lint:setup-js:changed` — build and lint `../actions/setup/js/*.cjs` files. diff --git a/actions/setup/js/eslint-factory/eslint.config.cjs b/eslint-factory/eslint.config.cjs similarity index 100% rename from actions/setup/js/eslint-factory/eslint.config.cjs rename to eslint-factory/eslint.config.cjs diff --git a/actions/setup/js/eslint-factory/package-lock.json b/eslint-factory/package-lock.json similarity index 100% rename from actions/setup/js/eslint-factory/package-lock.json rename to eslint-factory/package-lock.json diff --git a/actions/setup/js/eslint-factory/package.json b/eslint-factory/package.json similarity index 54% rename from actions/setup/js/eslint-factory/package.json rename to eslint-factory/package.json index 2ac341a26f0..4e097047465 100644 --- a/actions/setup/js/eslint-factory/package.json +++ b/eslint-factory/package.json @@ -2,14 +2,14 @@ "name": "@github/gh-aw-eslint-factory", "version": "0.1.0", "private": true, - "description": "Custom ESLint rule factory for actions/setup/js", + "description": "Custom ESLint rule factory for gh-aw JavaScript runtime code", "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { "build": "tsc -p tsconfig.json", "clean": "rm -rf dist", - "lint:setup-js": "npm run build && cd .. && ./eslint-factory/node_modules/.bin/eslint --config eslint-factory/eslint.config.cjs .", - "lint:setup-js:changed": "npm run build && cd .. && ./eslint-factory/node_modules/.bin/eslint --config eslint-factory/eslint.config.cjs '*.cjs'", + "lint:setup-js": "npm run build && cd ../actions/setup/js && \"$INIT_CWD\"/node_modules/.bin/eslint --config \"$INIT_CWD\"/eslint.config.cjs .", + "lint:setup-js:changed": "npm run build && cd ../actions/setup/js && \"$INIT_CWD\"/node_modules/.bin/eslint --config \"$INIT_CWD\"/eslint.config.cjs '*.cjs'", "test": "vitest run" }, "devDependencies": { diff --git a/actions/setup/js/eslint-factory/src/index.ts b/eslint-factory/src/index.ts similarity index 100% rename from actions/setup/js/eslint-factory/src/index.ts rename to eslint-factory/src/index.ts diff --git a/actions/setup/js/eslint-factory/src/rules/require-json-parse-try-catch.test.ts b/eslint-factory/src/rules/require-json-parse-try-catch.test.ts similarity index 94% rename from actions/setup/js/eslint-factory/src/rules/require-json-parse-try-catch.test.ts rename to eslint-factory/src/rules/require-json-parse-try-catch.test.ts index 639c504930e..9839f976d46 100644 --- a/actions/setup/js/eslint-factory/src/rules/require-json-parse-try-catch.test.ts +++ b/eslint-factory/src/rules/require-json-parse-try-catch.test.ts @@ -19,11 +19,7 @@ const esmRuleTester = new RuleTester({ describe("require-json-parse-try-catch", () => { it("valid: JSON.parse inside try block passes (CommonJS)", () => { cjsRuleTester.run("require-json-parse-try-catch", requireJsonParseTryCatchRule, { - valid: [ - `try { const x = JSON.parse(str); } catch (e) {}`, - `try { return JSON.parse(str); } catch (e) {}`, - `function f() { try { JSON.parse(str); } catch (e) {} }`, - ], + valid: [`try { const x = JSON.parse(str); } catch (e) {}`, `try { return JSON.parse(str); } catch (e) {}`, `function f() { try { JSON.parse(str); } catch (e) {} }`], invalid: [], }); }); diff --git a/actions/setup/js/eslint-factory/src/rules/require-json-parse-try-catch.ts b/eslint-factory/src/rules/require-json-parse-try-catch.ts similarity index 98% rename from actions/setup/js/eslint-factory/src/rules/require-json-parse-try-catch.ts rename to eslint-factory/src/rules/require-json-parse-try-catch.ts index ebbd9ceac3b..2e59540c129 100644 --- a/actions/setup/js/eslint-factory/src/rules/require-json-parse-try-catch.ts +++ b/eslint-factory/src/rules/require-json-parse-try-catch.ts @@ -1,6 +1,6 @@ import { AST_NODE_TYPES, ESLintUtils, TSESTree } from "@typescript-eslint/utils"; -const createRule = ESLintUtils.RuleCreator(name => `https://github.com/github/gh-aw/tree/main/actions/setup/js/eslint-factory#${name}`); +const createRule = ESLintUtils.RuleCreator(name => `https://github.com/github/gh-aw/tree/main/eslint-factory#${name}`); // Statement node types that can be directly wrapped in a try/catch block. const WRAPPABLE_STATEMENT_TYPES = new Set([AST_NODE_TYPES.ExpressionStatement, AST_NODE_TYPES.VariableDeclaration, AST_NODE_TYPES.ReturnStatement, AST_NODE_TYPES.ThrowStatement]); diff --git a/actions/setup/js/eslint-factory/src/rules/require-parseInt-radix.ts b/eslint-factory/src/rules/require-parseInt-radix.ts similarity index 100% rename from actions/setup/js/eslint-factory/src/rules/require-parseInt-radix.ts rename to eslint-factory/src/rules/require-parseInt-radix.ts diff --git a/actions/setup/js/eslint-factory/tsconfig.json b/eslint-factory/tsconfig.json similarity index 100% rename from actions/setup/js/eslint-factory/tsconfig.json rename to eslint-factory/tsconfig.json diff --git a/actions/setup/js/eslint-factory/vitest.config.ts b/eslint-factory/vitest.config.ts similarity index 100% rename from actions/setup/js/eslint-factory/vitest.config.ts rename to eslint-factory/vitest.config.ts