Skip to content

Rewrite lock-issue script to export main and call via require()#7437

Merged
pelikhan merged 4 commits intomainfrom
copilot/rewrite-lock-issue-script
Dec 23, 2025
Merged

Rewrite lock-issue script to export main and call via require()#7437
pelikhan merged 4 commits intomainfrom
copilot/rewrite-lock-issue-script

Conversation

Copy link
Contributor

Copilot AI commented Dec 23, 2025

The lock-issue.cjs script was calling main() directly instead of exporting it, causing inconsistency with unlock-issue.cjs and preventing proper invocation via require().

Changes

  • pkg/workflow/js/lock-issue.cjs: Export main function instead of calling directly

    // Before
    await main();
    
    // After
    module.exports = { main };
  • pkg/workflow/compiler_activation_jobs.go: Call main via require() pattern

    // Before
    steps = append(steps, "            require('"+SetupActionDestination+"/lock-issue.cjs');\n")
    
    // After
    steps = append(steps, "            const { main } = require('"+SetupActionDestination+"/lock-issue.cjs');\n")
    steps = append(steps, "            await main();\n")
  • pkg/workflow/lock_for_agent_test.go: Update tests to verify require() pattern instead of inline JavaScript

Both lock and unlock scripts now use consistent invocation patterns in compiled workflows.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login 5/interpolate_prompt.js --jq /usr/lib/git-core/git-remote-https l GOWORK 64/pkg/tool/linu--show-toplevel /usr/lib/git-core/git-remote-https orig�� ithub/workflows 64/pkg/tool/linuGO111MODULE e/git-remote-https by/9c1531151d72bgh git 64/bin/go e/git-remote-htt--json (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login tags/v6 --jq /usr/bin/git pment dependencigit gh 64/bin/go git rev-�� ithub/workflows 1; \ fi /usr/bin/git rite '../../**/*infocmp infocmp 64/bin/go git (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login k/gh-aw/gh-aw/.github/workflows git e/git l Rewrite lock-iss-1 64/bin/go e/git auth�� om/actions/ai-inference.git om/actions/ai-inference.git "CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt", "REQUESTS_CA_B--no-pager t ./...)" ]; thegh infocmp 64/bin/go git (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Reference: https://github.com/githubnext/gh-aw/actions/runs/20470395569/job/58824199013#step:5:1

Rewrite the lock issue script to export main and call it from the script.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 23, 2025 20:10
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- 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>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Rewrite lock issue script to export main function Rewrite lock-issue script to export main and call via require() Dec 23, 2025
Copilot AI requested a review from pelikhan December 23, 2025 20:27
@pelikhan pelikhan marked this pull request as ready for review December 23, 2025 20:33
@pelikhan pelikhan merged commit a84f16c into main Dec 23, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/rewrite-lock-issue-script branch December 23, 2025 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants