From ebc4ff9975cd8804ca5d747f97d60ba7b8a43113 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 20:05:32 +0000 Subject: [PATCH 1/4] Initial plan From 5fad1e4d125705d69ede2a5cae1c1de025995ca9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 20:10:38 +0000 Subject: [PATCH 2/4] Initial plan for rewriting lock-issue script Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/issue-classifier.lock.yml | 2 +- .github/workflows/release.lock.yml | 6 +++--- .github/workflows/stale-repo-identifier.lock.yml | 2 +- .github/workflows/super-linter.lock.yml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/issue-classifier.lock.yml b/.github/workflows/issue-classifier.lock.yml index 3be5ab9acd8..4f4a69a3e57 100644 --- a/.github/workflows/issue-classifier.lock.yml +++ b/.github/workflows/issue-classifier.lock.yml @@ -2241,7 +2241,7 @@ jobs: path: /tmp/gh-aw/aw_info.json if-no-files-found: warn - name: Run AI Inference - uses: actions/ai-inference@334892bb203895caaed82ec52d23c1ed9385151e # v2.0.4 + uses: actions/ai-inference@334892bb203895caaed82ec52d23c1ed9385151e # v1 env: GH_AW_MCP_CONFIG: /tmp/gh-aw/mcp-config/mcp-servers.json GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index ce61da11ec3..8433f151f17 100644 --- a/.github/workflows/release.lock.yml +++ b/.github/workflows/release.lock.yml @@ -6056,13 +6056,13 @@ jobs: - name: Download Go modules run: go mod download - name: Generate SBOM (SPDX format) - uses: anchore/sbom-action@43a17d6e7add2b5535efe4dcae9952337c479a93 # v0.20.11 + uses: anchore/sbom-action@43a17d6e7add2b5535efe4dcae9952337c479a93 # v0.20.10 with: artifact-name: sbom.spdx.json format: spdx-json output-file: sbom.spdx.json - name: Generate SBOM (CycloneDX format) - uses: anchore/sbom-action@43a17d6e7add2b5535efe4dcae9952337c479a93 # v0.20.11 + uses: anchore/sbom-action@43a17d6e7add2b5535efe4dcae9952337c479a93 # v0.20.10 with: artifact-name: sbom.cdx.json format: cyclonedx-json @@ -6261,7 +6261,7 @@ jobs: fetch-depth: 0 persist-credentials: false - name: Release with gh-extension-precompile - uses: cli/gh-extension-precompile@9e2237c30f869ad3bcaed6a4be2cd43564dd421b # v2.1.0 + uses: cli/gh-extension-precompile@9e2237c30f869ad3bcaed6a4be2cd43564dd421b # v2 with: build_script_override: scripts/build-release.sh go_version_file: go.mod diff --git a/.github/workflows/stale-repo-identifier.lock.yml b/.github/workflows/stale-repo-identifier.lock.yml index 21caadf4297..a8cd91dcd02 100644 --- a/.github/workflows/stale-repo-identifier.lock.yml +++ b/.github/workflows/stale-repo-identifier.lock.yml @@ -176,7 +176,7 @@ jobs: ORGANIZATION: ${{ env.ORGANIZATION }} id: stale-repos name: Run stale_repos tool - uses: github/stale-repos@a21e55567b83cf3c3f3f9085d3038dc6cee02598 # v3.0.2 + uses: github/stale-repos@a21e55567b83cf3c3f3f9085d3038dc6cee02598 # v3 - env: INACTIVE_REPOS: ${{ steps.stale-repos.outputs.inactiveRepos }} name: Save stale repos output diff --git a/.github/workflows/super-linter.lock.yml b/.github/workflows/super-linter.lock.yml index 4c2fde522cd..b15660af2fb 100644 --- a/.github/workflows/super-linter.lock.yml +++ b/.github/workflows/super-linter.lock.yml @@ -6189,7 +6189,7 @@ jobs: persist-credentials: false - name: Super-linter id: super-linter - uses: super-linter/super-linter@47984f49b4e87383eed97890fe2dca6063bbd9c3 # v8.3.1 + uses: super-linter/super-linter@47984f49b4e87383eed97890fe2dca6063bbd9c3 # v8.2.1 env: CREATE_LOG_FILE: "true" DEFAULT_BRANCH: main From fbbf6f838a4a028fe4aa804e11a589e327d8447b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 20:18:22 +0000 Subject: [PATCH 3/4] Rewrite lock-issue script to export main and call from require - Updated lock-issue.cjs to export main function instead of calling it directly - Updated compiler_activation_jobs.go to call main via require() like unlock-issue - Updated actions-build to sync the updated lock-issue.cjs file - Fixed lock_for_agent_test.go to check for require() pattern instead of inline JS - All lock_for_agent tests now passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/ai-moderator.lock.yml | 3 ++- .github/workflows/campaign-generator.lock.yml | 3 ++- .github/workflows/issue-classifier.lock.yml | 2 +- .github/workflows/release.lock.yml | 6 +++--- .github/workflows/stale-repo-identifier.lock.yml | 2 +- .github/workflows/super-linter.lock.yml | 2 +- .github/workflows/workflow-generator.lock.yml | 3 ++- actions/setup/js/add_comment.cjs | 10 +++++----- actions/setup/js/lock-issue.cjs | 2 +- actions/setup/js/noop.cjs | 2 +- pkg/workflow/compiler_activation_jobs.go | 3 ++- pkg/workflow/js/lock-issue.cjs | 2 +- pkg/workflow/lock_for_agent_test.go | 8 ++++---- 13 files changed, 26 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ai-moderator.lock.yml b/.github/workflows/ai-moderator.lock.yml index a6e22128ab0..d717a32e33b 100644 --- a/.github/workflows/ai-moderator.lock.yml +++ b/.github/workflows/ai-moderator.lock.yml @@ -93,7 +93,8 @@ jobs: global.context = context; global.exec = exec; global.io = io; - require('/tmp/gh-aw/actions/lock-issue.cjs'); + const { main } = require('/tmp/gh-aw/actions/lock-issue.cjs'); + await main(); agent: needs: activation diff --git a/.github/workflows/campaign-generator.lock.yml b/.github/workflows/campaign-generator.lock.yml index 3dc9aae0391..1dd97e42233 100644 --- a/.github/workflows/campaign-generator.lock.yml +++ b/.github/workflows/campaign-generator.lock.yml @@ -81,7 +81,8 @@ jobs: global.context = context; global.exec = exec; global.io = io; - require('/tmp/gh-aw/actions/lock-issue.cjs'); + const { main } = require('/tmp/gh-aw/actions/lock-issue.cjs'); + await main(); agent: needs: activation diff --git a/.github/workflows/issue-classifier.lock.yml b/.github/workflows/issue-classifier.lock.yml index 4f4a69a3e57..3be5ab9acd8 100644 --- a/.github/workflows/issue-classifier.lock.yml +++ b/.github/workflows/issue-classifier.lock.yml @@ -2241,7 +2241,7 @@ jobs: path: /tmp/gh-aw/aw_info.json if-no-files-found: warn - name: Run AI Inference - uses: actions/ai-inference@334892bb203895caaed82ec52d23c1ed9385151e # v1 + uses: actions/ai-inference@334892bb203895caaed82ec52d23c1ed9385151e # v2.0.4 env: GH_AW_MCP_CONFIG: /tmp/gh-aw/mcp-config/mcp-servers.json GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index 8433f151f17..ce61da11ec3 100644 --- a/.github/workflows/release.lock.yml +++ b/.github/workflows/release.lock.yml @@ -6056,13 +6056,13 @@ jobs: - name: Download Go modules run: go mod download - name: Generate SBOM (SPDX format) - uses: anchore/sbom-action@43a17d6e7add2b5535efe4dcae9952337c479a93 # v0.20.10 + uses: anchore/sbom-action@43a17d6e7add2b5535efe4dcae9952337c479a93 # v0.20.11 with: artifact-name: sbom.spdx.json format: spdx-json output-file: sbom.spdx.json - name: Generate SBOM (CycloneDX format) - uses: anchore/sbom-action@43a17d6e7add2b5535efe4dcae9952337c479a93 # v0.20.10 + uses: anchore/sbom-action@43a17d6e7add2b5535efe4dcae9952337c479a93 # v0.20.11 with: artifact-name: sbom.cdx.json format: cyclonedx-json @@ -6261,7 +6261,7 @@ jobs: fetch-depth: 0 persist-credentials: false - name: Release with gh-extension-precompile - uses: cli/gh-extension-precompile@9e2237c30f869ad3bcaed6a4be2cd43564dd421b # v2 + uses: cli/gh-extension-precompile@9e2237c30f869ad3bcaed6a4be2cd43564dd421b # v2.1.0 with: build_script_override: scripts/build-release.sh go_version_file: go.mod diff --git a/.github/workflows/stale-repo-identifier.lock.yml b/.github/workflows/stale-repo-identifier.lock.yml index a8cd91dcd02..21caadf4297 100644 --- a/.github/workflows/stale-repo-identifier.lock.yml +++ b/.github/workflows/stale-repo-identifier.lock.yml @@ -176,7 +176,7 @@ jobs: ORGANIZATION: ${{ env.ORGANIZATION }} id: stale-repos name: Run stale_repos tool - uses: github/stale-repos@a21e55567b83cf3c3f3f9085d3038dc6cee02598 # v3 + uses: github/stale-repos@a21e55567b83cf3c3f3f9085d3038dc6cee02598 # v3.0.2 - env: INACTIVE_REPOS: ${{ steps.stale-repos.outputs.inactiveRepos }} name: Save stale repos output diff --git a/.github/workflows/super-linter.lock.yml b/.github/workflows/super-linter.lock.yml index b15660af2fb..4c2fde522cd 100644 --- a/.github/workflows/super-linter.lock.yml +++ b/.github/workflows/super-linter.lock.yml @@ -6189,7 +6189,7 @@ jobs: persist-credentials: false - name: Super-linter id: super-linter - uses: super-linter/super-linter@47984f49b4e87383eed97890fe2dca6063bbd9c3 # v8.2.1 + uses: super-linter/super-linter@47984f49b4e87383eed97890fe2dca6063bbd9c3 # v8.3.1 env: CREATE_LOG_FILE: "true" DEFAULT_BRANCH: main diff --git a/.github/workflows/workflow-generator.lock.yml b/.github/workflows/workflow-generator.lock.yml index e1aabcff8ee..9e6151ad389 100644 --- a/.github/workflows/workflow-generator.lock.yml +++ b/.github/workflows/workflow-generator.lock.yml @@ -81,7 +81,8 @@ jobs: global.context = context; global.exec = exec; global.io = io; - require('/tmp/gh-aw/actions/lock-issue.cjs'); + const { main } = require('/tmp/gh-aw/actions/lock-issue.cjs'); + await main(); agent: needs: activation diff --git a/actions/setup/js/add_comment.cjs b/actions/setup/js/add_comment.cjs index 9a8f567a158..80cc9399e68 100644 --- a/actions/setup/js/add_comment.cjs +++ b/actions/setup/js/add_comment.cjs @@ -1,11 +1,11 @@ // @ts-check /// -const { loadAgentOutput } = require("/tmp/gh-aw/actions/load_agent_output.cjs"); -const { generateFooterWithMessages } = require("/tmp/gh-aw/actions/messages_footer.cjs"); -const { getRepositoryUrl } = require("/tmp/gh-aw/actions/get_repository_url.cjs"); -const { replaceTemporaryIdReferences, loadTemporaryIdMap } = require("/tmp/gh-aw/actions/temporary_id.cjs"); -const { getTrackerID } = require("/tmp/gh-aw/actions/get_tracker_id.cjs"); +const { loadAgentOutput } = require("./load_agent_output.cjs"); +const { generateFooterWithMessages } = require("./messages_footer.cjs"); +const { getRepositoryUrl } = require("./get_repository_url.cjs"); +const { replaceTemporaryIdReferences, loadTemporaryIdMap } = require("./temporary_id.cjs"); +const { getTrackerID } = require("./get_tracker_id.cjs"); /** * Hide/minimize a comment using the GraphQL API diff --git a/actions/setup/js/lock-issue.cjs b/actions/setup/js/lock-issue.cjs index 780bb3321bf..0e26b67b8ea 100644 --- a/actions/setup/js/lock-issue.cjs +++ b/actions/setup/js/lock-issue.cjs @@ -66,4 +66,4 @@ async function main() { } } -await main(); +module.exports = { main }; diff --git a/actions/setup/js/noop.cjs b/actions/setup/js/noop.cjs index e643e1e03dd..6bcba542d2f 100644 --- a/actions/setup/js/noop.cjs +++ b/actions/setup/js/noop.cjs @@ -1,7 +1,7 @@ // @ts-check /// -const { loadAgentOutput } = require("/tmp/gh-aw/actions/load_agent_output.cjs"); +const { loadAgentOutput } = require("./load_agent_output.cjs"); /** * Main function to handle noop safe output diff --git a/pkg/workflow/compiler_activation_jobs.go b/pkg/workflow/compiler_activation_jobs.go index 7ea8be975f2..e25db2cdbaa 100644 --- a/pkg/workflow/compiler_activation_jobs.go +++ b/pkg/workflow/compiler_activation_jobs.go @@ -495,7 +495,8 @@ func (c *Compiler) buildActivationJob(data *WorkflowData, preActivationJobCreate steps = append(steps, " global.context = context;\n") steps = append(steps, " global.exec = exec;\n") steps = append(steps, " global.io = io;\n") - steps = append(steps, " require('"+SetupActionDestination+"/lock-issue.cjs');\n") + steps = append(steps, " const { main } = require('"+SetupActionDestination+"/lock-issue.cjs');\n") + steps = append(steps, " await main();\n") } else { // Add the lock-issue script formattedScript := FormatJavaScriptForYAML(lockIssueScript) diff --git a/pkg/workflow/js/lock-issue.cjs b/pkg/workflow/js/lock-issue.cjs index 780bb3321bf..0e26b67b8ea 100644 --- a/pkg/workflow/js/lock-issue.cjs +++ b/pkg/workflow/js/lock-issue.cjs @@ -66,4 +66,4 @@ async function main() { } } -await main(); +module.exports = { main }; diff --git a/pkg/workflow/lock_for_agent_test.go b/pkg/workflow/lock_for_agent_test.go index 3501bcf1dd0..c016391380f 100644 --- a/pkg/workflow/lock_for_agent_test.go +++ b/pkg/workflow/lock_for_agent_test.go @@ -59,8 +59,8 @@ Test workflow with lock-for-agent enabled. "Lock issue for agent workflow", "Unlock issue after agent workflow", "GH_AW_LOCK_FOR_AGENT: \"true\"", - "lockForAgent && (eventName === \"issues\" || eventName === \"issue_comment\")", - "This issue has been locked while the workflow is running", + "lock-issue.cjs", // Check for require() call to lock-issue script + "unlock-issue.cjs", // Check for require() call to unlock-issue script } for _, expected := range expectedStrings { @@ -378,8 +378,8 @@ Test workflow with lock-for-agent enabled for issue_comment events. "Lock issue for agent workflow", "Unlock issue after agent workflow", "GH_AW_LOCK_FOR_AGENT: \"true\"", - "lockForAgent && (eventName === \"issues\" || eventName === \"issue_comment\")", - "This issue has been locked while the workflow is running", + "lock-issue.cjs", // Check for require() call to lock-issue script + "unlock-issue.cjs", // Check for require() call to unlock-issue script } for _, expected := range expectedStrings { From 471705e4e76da66807a85fc78a9234eaee29f04c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 23 Dec 2025 20:24:06 +0000 Subject: [PATCH 4/4] Final validation completed - all lock_for_agent tests passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- pkg/workflow/lock_for_agent_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/workflow/lock_for_agent_test.go b/pkg/workflow/lock_for_agent_test.go index c016391380f..54ccf89a629 100644 --- a/pkg/workflow/lock_for_agent_test.go +++ b/pkg/workflow/lock_for_agent_test.go @@ -59,7 +59,7 @@ Test workflow with lock-for-agent enabled. "Lock issue for agent workflow", "Unlock issue after agent workflow", "GH_AW_LOCK_FOR_AGENT: \"true\"", - "lock-issue.cjs", // Check for require() call to lock-issue script + "lock-issue.cjs", // Check for require() call to lock-issue script "unlock-issue.cjs", // Check for require() call to unlock-issue script } @@ -378,7 +378,7 @@ Test workflow with lock-for-agent enabled for issue_comment events. "Lock issue for agent workflow", "Unlock issue after agent workflow", "GH_AW_LOCK_FOR_AGENT: \"true\"", - "lock-issue.cjs", // Check for require() call to lock-issue script + "lock-issue.cjs", // Check for require() call to lock-issue script "unlock-issue.cjs", // Check for require() call to unlock-issue script }