Skip to content

Refactor repo-memory clone script to separate shell file#8002

Merged
pelikhan merged 4 commits into
mainfrom
copilot/refactor-clone-script-to-sh
Dec 28, 2025
Merged

Refactor repo-memory clone script to separate shell file#8002
pelikhan merged 4 commits into
mainfrom
copilot/refactor-clone-script-to-sh

Conversation

Copilot AI commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

Extracts inline bash code for cloning repo-memory branches from Go into a standalone shell script following the existing pattern used by other setup scripts.

Changes

  • New script: actions/setup/sh/clone_repo_memory_branch.sh

    • Handles branch cloning with shallow clone (--depth 1 --single-branch)
    • Creates orphan branches when they don't exist (configurable)
    • Validates required environment variables
  • Simplified Go code: pkg/workflow/repo_memory.go

    • Replaced ~40 lines of inline bash string generation with script invocation
    • Passes configuration via environment variables (BRANCH_NAME, TARGET_REPO, MEMORY_DIR, CREATE_ORPHAN)
  • Updated tests: pkg/workflow/repo_memory_test.go

    • Validates script call and environment variable configuration instead of inline commands

Example

Before (inline bash):

builder.WriteString("        run: |\n")
builder.WriteString("          set +e\n")
fmt.Fprintf(builder, "          git clone --depth 1 --single-branch --branch \"%s\" ...\n", memory.BranchName)
// ... 30+ more lines of inline bash

After (script call):

builder.WriteString("        run: bash /tmp/gh-aw/actions/clone_repo_memory_branch.sh\n")

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 -json GO111MODULE ux-amd64/bin/go GOINSECURE GOMOD l/linux_amd64/co/tmp/go-build3823752113/b291/gh-aw.test go env -json GO111MODULE ux-amd64/pkg/tool/linux_amd64/link GOINSECURE GOMOD GOMODCACHE ux-amd64/pkg/tool/linux_amd64/link (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login k/gh-aw/gh-aw/pkg/gitutil/gitutil.go k/gh-aw/gh-aw/pkg/gitutil/gitutil_test.go /bin/sh -p main mpile /bin/sh -c k/gh-aw/gh-aw/.github/workflows mpile /usr/bin/git l -c=4 l/linux_amd64/codownload git (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login tags/v5 go by/73e6c0a45c2020a09fb460dda16bf1b712af232604d49889bf9e04a798baf8a0/log.json l GO111MODULE 0.1-go1.25.0.lindownload git bf9e�� p-deno.git go /usr/bin/git -json GO111MODULE ux-amd64/pkg/toolist git (http block)

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

Original prompt

Refactor "repo-memory branch" clone script to a .sh file in actions/setup

  • name: Clone repo-memory branch (default)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Dec 28, 2025
Copilot AI and others added 2 commits December 28, 2025 17:09
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] Refactor clone script for repo-memory branch to .sh file Refactor repo-memory clone script to separate shell file Dec 28, 2025
Copilot AI requested a review from pelikhan December 28, 2025 17:23
@pelikhan pelikhan added the smoke label Dec 28, 2025
@github-actions

github-actions Bot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

🤖 ALERT: Smoke Copilot No Firewall failed. ANOMALY_DETECTED. REPAIR_REQUIRED.

@github-actions

github-actions Bot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions

github-actions Bot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

💀 Blimey! Smoke Copilot Safe Inputs failed and walked the plank! No treasure today, matey! ☠️

@github-actions

github-actions Bot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️

@github-actions

github-actions Bot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions

github-actions Bot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

github-actions Bot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

📰 DEVELOPING STORY: Smoke Copilot Playwright reports failed. Our correspondents are investigating the incident...

@pelikhan pelikhan marked this pull request as ready for review December 28, 2025 20:52
@pelikhan pelikhan merged commit f696f2a into main Dec 28, 2025
49 of 50 checks passed
@pelikhan pelikhan deleted the copilot/refactor-clone-script-to-sh branch December 28, 2025 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants