Skip to content

Commit 3ef4f18

Browse files
authored
Merge pull request #259 from goodpatch/fix/upgrade-gh-cli-in-publish-skills
🐛 fix: publish-skills で gh CLI 2.90+ を self-install
2 parents 97c208b + 9a0be34 commit 3ef4f18

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/publish-skills.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,25 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424

25-
- name: Verify gh CLI supports skill subcommand
25+
- name: Ensure gh CLI >= 2.90 (skill subcommand available)
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2628
run: |
29+
gh --version | head -n 1
30+
if gh help | grep -q '^ skill:'; then
31+
echo "gh skill subcommand already available"
32+
exit 0
33+
fi
34+
echo "Installing latest gh CLI from cli/cli releases"
35+
LATEST=$(gh api repos/cli/cli/releases/latest --jq .tag_name | sed 's/^v//')
36+
TARBALL="gh_${LATEST}_linux_amd64.tar.gz"
37+
curl -sSL -o "/tmp/${TARBALL}" "https://github.com/cli/cli/releases/download/v${LATEST}/${TARBALL}"
38+
tar -xzf "/tmp/${TARBALL}" -C /tmp
39+
sudo install -m 0755 "/tmp/gh_${LATEST}_linux_amd64/bin/gh" /usr/local/bin/gh
40+
hash -r
2741
gh --version | head -n 1
2842
if ! gh help | grep -q '^ skill:'; then
29-
echo "::error::gh skill subcommand not available (requires gh CLI v2.90+)"
43+
echo "::error::gh skill subcommand still not available after upgrade"
3044
exit 1
3145
fi
3246

0 commit comments

Comments
 (0)