Skip to content

feat(base): install gh-stack and gh-actions-lock GitHub CLI extensions - #8

Merged
amondnet merged 3 commits into
mainfrom
feat/gh-extensions
Oct 15, 2026
Merged

amondnet merged 3 commits into
mainfrom
feat/gh-extensions

Conversation

@amondnet

Copy link
Copy Markdown
Collaborator

개요

베이스 이미지에 GitHub CLI 확장 두 개를 설치합니다.

변경 사항

  • scripts/install-gh-extensions.sh (새 파일, coder 사용자): gh extension install로 두 확장을 설치하고, 각 확장을 실행해 설치를 확인합니다. gh extension list는 인증이 필요해서 확인용으로 쓰지 않았습니다.
  • Dockerfile: Graphite 설치 다음에 위 스크립트를 실행하는 단계를 추가했습니다. RUN --mount=type=secret,id=gh_token,mode=0444로 토큰을 이 명령에서만 읽을 수 있게 합니다.
  • .github/workflows/docker-publish.yml: build-push-action에 secrets: gh_token=${{ secrets.GITHUB_TOKEN }}를 추가했습니다.
  • 문서: CLAUDE.md, README.md, images/CLAUDE.md에 새 스크립트와 실행 순서를 추가했습니다.

왜 secret을 넘기나

두 확장은 공개 저장소라 인증 없이도 설치됩니다. 하지만 인증 없는 GitHub API는 IP당 시간당 60회로 제한되고, GitHub-hosted 러너는 IP를 여럿이 함께 씁니다. 그래서 매일 도는 빌드가 rate limit 때문에 가끔 실패할 수 있어, 있으면 쓰는 선택 사항으로 토큰을 넘깁니다. secret이 없으면(로컬 빌드, fork PR) 인증 없이 설치합니다.

검증

ubuntu:24.04 + gh(apt) + coder 사용자로 이 단계만 재현해 확인했습니다.

  • secret 없이 빌드: 두 확장 설치 성공, gh stack version 0.2.1
  • --secret id=gh_token으로 빌드: 설치 성공
  • 결과 이미지에 /run/secrets 없음, GH_TOKEN 환경 변수 없음, docker history에 토큰 흔적 없음
  • CI 전체 이미지 빌드 통과

참고

  • 확장은 ~/.local/share/gh/extensions/에 설치됩니다. Coder 템플릿이 /home/coder를 영구 볼륨으로 붙이면 기존 워크스페이스에는 반영되지 않습니다. coder.amond에는 두 확장이 이미 설치돼 있습니다(gh-stack v0.2.1, gh-actions-lock v0.2.0).
  • images/dev/.devcontainer 이미지는 이번 범위에서 제외했습니다.

작성자: 이민수 (Minsu Lee, @amondnet) · minsu.lee@passionfactory.ai

Add install-gh-extensions.sh (coder user) that installs github/gh-stack
and github/gh-actions-lock. Both install without authentication, but
unauthenticated API calls are limited to 60/hour per IP, which shared
GitHub-hosted runners can exhaust, so the publish workflow passes
GITHUB_TOKEN as an optional BuildKit secret (gh_token). The secret is
mounted only for that RUN step and never lands in an image layer.
@amondnet
amondnet marked this pull request as ready for review October 15, 2026 10:00

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

이번 풀 요청은 Coder 베이스 이미지에 GitHub CLI 확장 기능인 gh stack 및 gh actions-lock을 추가하고 관련 문서와 Dockerfile을 업데이트합니다. 리뷰어는 install-gh-extensions.sh 스크립트 실행 시 gh 명령어가 존재하지 않을 경우 명확한 에러 메시지와 함께 명시적으로 실패하도록 사전 검사 가드 코드를 추가할 것을 제안했습니다.

Comment thread images/base/scripts/install-gh-extensions.sh
@amondnet

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds GitHub CLI extensions (gh stack and gh actions-lock) to the Coder workspace base image, including updates to the Dockerfile, a new installation script, and documentation. The review feedback identifies a medium-severity issue in the installation script where set -e causes an immediate exit on failure, bypassing the custom error message, and suggests adding explicit error handlers for each installation command.

Comment thread images/base/scripts/install-gh-extensions.sh
@amondnet

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds GitHub CLI extensions (gh-stack and gh-actions-lock) to the Coder base Docker image, including a new installation script and corresponding documentation updates. The review feedback correctly identifies a high-severity issue in the Dockerfile where the BuildKit secret mount for gh_token lacks the optional=true attribute, which would cause build failures during local builds or fork PRs where the secret is not provided.

Comment thread images/base/Dockerfile
@amondnet
amondnet merged commit 76326ed into main Oct 15, 2026
2 checks passed
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.

1 participant