From f32e8388f0df265110d3ad8fa467b549cbff9833 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 27 May 2026 05:25:51 +0000 Subject: [PATCH 1/3] test(jsweep): improve add_labels.cjs test coverage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add tests for required_labels and required_title_prefix filter features, and add issues.get mock to default setup for these scenarios. - Add mockGithub.rest.issues.get default mock in beforeEach - Add 6 new tests covering required_labels filtering (pass/fail) - Add tests covering required_title_prefix filtering (pass/fail) - Add test for combined required_labels + required_title_prefix - Total: 39 → 45 tests (6 added) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- actions/setup/js/add_labels.test.cjs | 89 ++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/actions/setup/js/add_labels.test.cjs b/actions/setup/js/add_labels.test.cjs index 3d7c601956c..83d74a9077b 100644 --- a/actions/setup/js/add_labels.test.cjs +++ b/actions/setup/js/add_labels.test.cjs @@ -38,6 +38,12 @@ describe("add_labels", () => { rest: { issues: { addLabels: async () => ({}), + get: async () => ({ + data: { + title: "Test issue title", + labels: [], + }, + }), }, }, }; @@ -858,5 +864,88 @@ describe("add_labels", () => { expect(result.success).toBe(false); expect(result.error).toContain("No issue/PR number available"); }); + + it("should skip when item does not have all required_labels", async () => { + const handler = await main({ max: 10, required_labels: ["needs-triage"] }); + + mockGithub.rest.issues.get = async () => ({ + data: { title: "Some issue", labels: [{ name: "bug" }] }, + }); + + const result = await handler({ item_number: 100, labels: ["enhancement"] }, {}); + + expect(result.success).toBe(false); + expect(result.skipped).toBe(true); + expect(result.error).toContain("required-labels"); + }); + + it("should add labels when item has all required_labels", async () => { + const handler = await main({ max: 10, required_labels: ["needs-triage"] }); + const addLabelsCalls = []; + + mockGithub.rest.issues.get = async () => ({ + data: { title: "Some issue", labels: [{ name: "needs-triage" }, { name: "bug" }] }, + }); + mockGithub.rest.issues.addLabels = async params => { + addLabelsCalls.push(params); + return {}; + }; + + const result = await handler({ item_number: 100, labels: ["enhancement"] }, {}); + + expect(result.success).toBe(true); + expect(addLabelsCalls.length).toBe(1); + }); + + it("should skip when item title does not start with required_title_prefix", async () => { + const handler = await main({ max: 10, required_title_prefix: "[Bot]" }); + + mockGithub.rest.issues.get = async () => ({ + data: { title: "Regular issue title", labels: [] }, + }); + + const result = await handler({ item_number: 100, labels: ["bug"] }, {}); + + expect(result.success).toBe(false); + expect(result.skipped).toBe(true); + expect(result.error).toContain("required prefix"); + }); + + it("should add labels when item title starts with required_title_prefix", async () => { + const handler = await main({ max: 10, required_title_prefix: "[Bot]" }); + const addLabelsCalls = []; + + mockGithub.rest.issues.get = async () => ({ + data: { title: "[Bot] Automated issue", labels: [] }, + }); + mockGithub.rest.issues.addLabels = async params => { + addLabelsCalls.push(params); + return {}; + }; + + const result = await handler({ item_number: 100, labels: ["automation"] }, {}); + + expect(result.success).toBe(true); + expect(addLabelsCalls.length).toBe(1); + }); + + it("should check both required_labels and required_title_prefix together", async () => { + const handler = await main({ + max: 10, + required_labels: ["approved"], + required_title_prefix: "[Ready]", + }); + + // Passes required_labels but fails required_title_prefix + mockGithub.rest.issues.get = async () => ({ + data: { title: "Not ready issue", labels: [{ name: "approved" }] }, + }); + + const result = await handler({ item_number: 100, labels: ["bug"] }, {}); + + expect(result.success).toBe(false); + expect(result.skipped).toBe(true); + expect(result.error).toContain("required prefix"); + }); }); }); From 9eb51a2f20f3adaa38e44f717f3f68887bca05e6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 27 May 2026 10:26:07 +0000 Subject: [PATCH 2/3] chore: outline plan for review feedback Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- ...ly-compiler-threat-spec-optimizer.lock.yml | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml b/.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml index dc7ee0fa391..8211ad5dfce 100644 --- a/.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml +++ b/.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"92d4db5190674780e53e1c9dc02d7ec3b44e9b37467aa8c5d7599fb7ccfe033e","body_hash":"8761535078c69ec3df664e51b40b25d49c9704cc69a8a6bfe003ffe4409bd20c","strict":true,"agent_id":"copilot"} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"3318b7415c6a6e13a76c9ab75cf996e2c7ef63ebbec2e216cf57489a448081b1","body_hash":"8761535078c69ec3df664e51b40b25d49c9704cc69a8a6bfe003ffe4409bd20c","strict":true,"agent_id":"copilot"} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_CI_TRIGGER_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/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"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.25.55"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.55"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.25.55"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.55"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.19"},{"image":"ghcr.io/github/github-mcp-server:v1.0.4","digest":"sha256:e3816a476a977cfb836e7d221510011436c654d11861db66ecfd826601aba6a4","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.4@sha256:e3816a476a977cfb836e7d221510011436c654d11861db66ecfd826601aba6a4"},{"image":"node:lts-alpine","digest":"sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14","pinned_image":"node:lts-alpine@sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14"}]} # ___ _ _ # / _ \ | | (_) @@ -62,8 +62,8 @@ name: "Daily Compiler Threat Spec Optimizer" on: schedule: - - cron: "19 2 * * *" - # Friendly format: daily (scattered) + - cron: "6 3 * * 1" + # Friendly format: weekly on monday around 03:00 (scattered) workflow_dispatch: inputs: aw_context: @@ -208,23 +208,23 @@ jobs: run: | bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_6801afa46256074c_EOF' + cat << 'GH_AW_PROMPT_6bd877931be036c6_EOF' - GH_AW_PROMPT_6801afa46256074c_EOF + GH_AW_PROMPT_6bd877931be036c6_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_6801afa46256074c_EOF' + cat << 'GH_AW_PROMPT_6bd877931be036c6_EOF' Tools: create_discussion, create_pull_request, missing_tool, missing_data, noop - GH_AW_PROMPT_6801afa46256074c_EOF + GH_AW_PROMPT_6bd877931be036c6_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_create_pull_request.md" - cat << 'GH_AW_PROMPT_6801afa46256074c_EOF' + cat << 'GH_AW_PROMPT_6bd877931be036c6_EOF' - GH_AW_PROMPT_6801afa46256074c_EOF + GH_AW_PROMPT_6bd877931be036c6_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md" - cat << 'GH_AW_PROMPT_6801afa46256074c_EOF' + cat << 'GH_AW_PROMPT_6bd877931be036c6_EOF' The following GitHub context information is available for this workflow: {{#if github.actor}} @@ -253,15 +253,15 @@ jobs: {{/if}} - GH_AW_PROMPT_6801afa46256074c_EOF + GH_AW_PROMPT_6bd877931be036c6_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/cli_proxy_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_6801afa46256074c_EOF' + cat << 'GH_AW_PROMPT_6bd877931be036c6_EOF' {{#runtime-import .github/workflows/shared/otlp.md}} {{#runtime-import .github/workflows/shared/reporting.md}} {{#runtime-import .github/workflows/shared/noop-reminder.md}} {{#runtime-import .github/workflows/daily-compiler-threat-spec-optimizer.md}} - GH_AW_PROMPT_6801afa46256074c_EOF + GH_AW_PROMPT_6bd877931be036c6_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -481,9 +481,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_9d020f430f3c4f8f_EOF' + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_fd3adc6fcc4e382b_EOF' {"create_discussion":{"category":"audits","close_older_discussions":true,"expires":72,"fallback_to_issue":true,"max":1,"title_prefix":"[compiler-threat-spec] "},"create_pull_request":{"draft":false,"expires":168,"labels":["security","compiler","specification","automation"],"max":1,"max_patch_files":100,"max_patch_size":1024,"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":"request_review","title_prefix":"[compiler-threat-spec] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} - GH_AW_SAFE_OUTPUTS_CONFIG_9d020f430f3c4f8f_EOF + GH_AW_SAFE_OUTPUTS_CONFIG_fd3adc6fcc4e382b_EOF - name: Generate Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | @@ -723,7 +723,7 @@ jobs: mkdir -p /home/runner/.copilot GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_e6c1f019753cc2b0_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_db88cf8bac8590ee_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { "safeoutputs": { @@ -753,7 +753,7 @@ jobs: } } } - GH_AW_MCP_CONFIG_e6c1f019753cc2b0_EOF + GH_AW_MCP_CONFIG_db88cf8bac8590ee_EOF - name: Mount MCP servers as CLIs id: mount-mcp-clis continue-on-error: true From 33c9269dd54b64decc9b2b500143eacee5e3593c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 27 May 2026 10:29:09 +0000 Subject: [PATCH 3/3] test: add missing combined filter coverage for add_labels Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- ...ly-compiler-threat-spec-optimizer.lock.yml | 34 +++++++++---------- actions/setup/js/add_labels.test.cjs | 22 ++++++++++++ 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml b/.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml index 8211ad5dfce..dc7ee0fa391 100644 --- a/.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml +++ b/.github/workflows/daily-compiler-threat-spec-optimizer.lock.yml @@ -1,4 +1,4 @@ -# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"3318b7415c6a6e13a76c9ab75cf996e2c7ef63ebbec2e216cf57489a448081b1","body_hash":"8761535078c69ec3df664e51b40b25d49c9704cc69a8a6bfe003ffe4409bd20c","strict":true,"agent_id":"copilot"} +# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"92d4db5190674780e53e1c9dc02d7ec3b44e9b37467aa8c5d7599fb7ccfe033e","body_hash":"8761535078c69ec3df664e51b40b25d49c9704cc69a8a6bfe003ffe4409bd20c","strict":true,"agent_id":"copilot"} # gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_CI_TRIGGER_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/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"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.25.55"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.55"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.25.55"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.55"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.19"},{"image":"ghcr.io/github/github-mcp-server:v1.0.4","digest":"sha256:e3816a476a977cfb836e7d221510011436c654d11861db66ecfd826601aba6a4","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.4@sha256:e3816a476a977cfb836e7d221510011436c654d11861db66ecfd826601aba6a4"},{"image":"node:lts-alpine","digest":"sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14","pinned_image":"node:lts-alpine@sha256:2bdb65ed1dab192432bc31c95f94155ca5ad7fc1392fb7eb7526ab682fa5bf14"}]} # ___ _ _ # / _ \ | | (_) @@ -62,8 +62,8 @@ name: "Daily Compiler Threat Spec Optimizer" on: schedule: - - cron: "6 3 * * 1" - # Friendly format: weekly on monday around 03:00 (scattered) + - cron: "19 2 * * *" + # Friendly format: daily (scattered) workflow_dispatch: inputs: aw_context: @@ -208,23 +208,23 @@ jobs: run: | bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" { - cat << 'GH_AW_PROMPT_6bd877931be036c6_EOF' + cat << 'GH_AW_PROMPT_6801afa46256074c_EOF' - GH_AW_PROMPT_6bd877931be036c6_EOF + GH_AW_PROMPT_6801afa46256074c_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" - cat << 'GH_AW_PROMPT_6bd877931be036c6_EOF' + cat << 'GH_AW_PROMPT_6801afa46256074c_EOF' Tools: create_discussion, create_pull_request, missing_tool, missing_data, noop - GH_AW_PROMPT_6bd877931be036c6_EOF + GH_AW_PROMPT_6801afa46256074c_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_create_pull_request.md" - cat << 'GH_AW_PROMPT_6bd877931be036c6_EOF' + cat << 'GH_AW_PROMPT_6801afa46256074c_EOF' - GH_AW_PROMPT_6bd877931be036c6_EOF + GH_AW_PROMPT_6801afa46256074c_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/mcp_cli_tools_prompt.md" - cat << 'GH_AW_PROMPT_6bd877931be036c6_EOF' + cat << 'GH_AW_PROMPT_6801afa46256074c_EOF' The following GitHub context information is available for this workflow: {{#if github.actor}} @@ -253,15 +253,15 @@ jobs: {{/if}} - GH_AW_PROMPT_6bd877931be036c6_EOF + GH_AW_PROMPT_6801afa46256074c_EOF cat "${RUNNER_TEMP}/gh-aw/prompts/cli_proxy_with_safeoutputs_prompt.md" - cat << 'GH_AW_PROMPT_6bd877931be036c6_EOF' + cat << 'GH_AW_PROMPT_6801afa46256074c_EOF' {{#runtime-import .github/workflows/shared/otlp.md}} {{#runtime-import .github/workflows/shared/reporting.md}} {{#runtime-import .github/workflows/shared/noop-reminder.md}} {{#runtime-import .github/workflows/daily-compiler-threat-spec-optimizer.md}} - GH_AW_PROMPT_6bd877931be036c6_EOF + GH_AW_PROMPT_6801afa46256074c_EOF } > "$GH_AW_PROMPT" - name: Interpolate variables and render templates uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 @@ -481,9 +481,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_fd3adc6fcc4e382b_EOF' + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_9d020f430f3c4f8f_EOF' {"create_discussion":{"category":"audits","close_older_discussions":true,"expires":72,"fallback_to_issue":true,"max":1,"title_prefix":"[compiler-threat-spec] "},"create_pull_request":{"draft":false,"expires":168,"labels":["security","compiler","specification","automation"],"max":1,"max_patch_files":100,"max_patch_size":1024,"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":"request_review","title_prefix":"[compiler-threat-spec] "},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{}} - GH_AW_SAFE_OUTPUTS_CONFIG_fd3adc6fcc4e382b_EOF + GH_AW_SAFE_OUTPUTS_CONFIG_9d020f430f3c4f8f_EOF - name: Generate Safe Outputs Tools env: GH_AW_TOOLS_META_JSON: | @@ -723,7 +723,7 @@ jobs: mkdir -p /home/runner/.copilot GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node) - cat << GH_AW_MCP_CONFIG_db88cf8bac8590ee_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" + cat << GH_AW_MCP_CONFIG_e6c1f019753cc2b0_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs" { "mcpServers": { "safeoutputs": { @@ -753,7 +753,7 @@ jobs: } } } - GH_AW_MCP_CONFIG_db88cf8bac8590ee_EOF + GH_AW_MCP_CONFIG_e6c1f019753cc2b0_EOF - name: Mount MCP servers as CLIs id: mount-mcp-clis continue-on-error: true diff --git a/actions/setup/js/add_labels.test.cjs b/actions/setup/js/add_labels.test.cjs index 83d74a9077b..81529fba70e 100644 --- a/actions/setup/js/add_labels.test.cjs +++ b/actions/setup/js/add_labels.test.cjs @@ -947,5 +947,27 @@ describe("add_labels", () => { expect(result.skipped).toBe(true); expect(result.error).toContain("required prefix"); }); + + it("should add labels when both required_labels and required_title_prefix match", async () => { + const handler = await main({ + max: 10, + required_labels: ["approved"], + required_title_prefix: "[Ready]", + }); + const addLabelsCalls = []; + + mockGithub.rest.issues.get = async () => ({ + data: { title: "[Ready] Ship it", labels: [{ name: "approved" }, { name: "bug" }] }, + }); + mockGithub.rest.issues.addLabels = async params => { + addLabelsCalls.push(params); + return {}; + }; + + const result = await handler({ item_number: 100, labels: ["enhancement"] }, {}); + + expect(result.success).toBe(true); + expect(addLabelsCalls.length).toBe(1); + }); }); });