Skip to content

Commit 5812879

Browse files
chaodu-agentpahud
andauthored
fix: symlink gh to ghp instead of bundling separate binary (#1268)
The pre-seed utils bundle should have gh as a symlink to ghp rather than a full copy of the gh CLI binary. ghp already delegates writes to the system gh, so bundling a separate copy is redundant and doubles the size. bin/ layout after this change: aws -> ../aws-cli/v2/current/bin/aws aws_completer -> ../aws-cli/v2/current/bin/aws_completer gh -> ghp ghp (binary) Co-authored-by: pahud <pahud@users.noreply.github.com>
1 parent 93c2709 commit 5812879

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/bundle-pre-seed-utils.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,9 @@ jobs:
8989
cp /tmp/ghp ./bin/ghp
9090
chmod +x ./bin/ghp
9191
92-
- name: Download gh CLI
92+
- name: Symlink gh to ghp
9393
run: |
94-
GH_VERSION=$(gh --version | head -1 | awk '{print $3}')
95-
# Use the runner's gh binary directly
96-
cp $(which gh) ./bin/gh
97-
chmod +x ./bin/gh
94+
cd bin && ln -sf ghp gh && cd ..
9895
9996
- name: Fix symlinks to be relative
10097
run: |
@@ -116,7 +113,9 @@ jobs:
116113
ls -la ./aws-cli/v2/
117114
echo "=== resolve test ==="
118115
./bin/aws --version
119-
./bin/ghp --version || true
116+
./bin/ghp --version
117+
# gh should resolve to ghp
118+
test "$(readlink ./bin/gh)" = "ghp"
120119
121120
- name: Create tarball
122121
run: |
@@ -161,7 +160,7 @@ jobs:
161160
**Contents:**
162161
- AWS CLI v${{ needs.resolve.outputs.aws_cli_version }}
163162
- ghp v${{ needs.resolve.outputs.ghpool_version }} (ghpool shim)
164-
- gh CLI (from runner)
163+
- gh → ghp symlink
165164
166165
**Usage:** Add to \`[hooks.pre_seed].sources\` as S3 URI after uploading." \
167166
artifacts/utils-x86_64.tar.gz \

0 commit comments

Comments
 (0)