C.W.K.
Stream
Lesson 01 of 12 · published

Repository secret

~11 min · secrets, repo, scope

Level 0Apprentice
0 XP0/101 lessons0/10 achievements
0/120 XP to next level120 XP to go0% complete

대부분의 secret 이 시작하는 곳

Repository secret 은 repo 설정에 암호화 저장된 key/value 쌍, 그 repo 에서 도는 workflow 에 사용 가능. Credential 필요할 때 default 위치.

설정 방법:

  • Repo Settings → Secrets and variables → Actions → New repository secret.
  • 또는 CLI: gh secret set NAME --body "value".
  • 또는 자동화 위해 API.

속성

  • 저장 시 암호화 (libsodium sealed box).
  • Write 권한 있는 사람이 trigger 한 workflow 에 보임. 중요하게, fork 의 PR (외부 contributor 의 pull_request) 이 trigger 한 workflow 에는 보임.
  • 이름은 관습적으로 대문자. 제한 charset: 알파벳숫자 + underscore. 숫자로 시작 금지. GITHUB_ 로 시작 금지 (예약).
  • Secret 당 최대 64 KB.
  • Repo 당 최대 100 secret, org 당 1000 (environment level 은 다른 limit).

Code

Repo secret 설정과 사용·bash
# Set via gh CLI
gh secret set OPENAI_API_KEY --body "$OPENAI_API_KEY"

# Or pipe from a file (no shell history exposure)
gh secret set DEPLOY_KEY < ~/.ssh/deploy_key

# List secret names (values are never returned)
gh secret list

# Delete
gh secret delete OLD_TOKEN
Workflow 에서 secret 사용·yaml
      - name: Call OpenAI
        env:
          OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
        run: python scripts/llm_eval.py

External links

Exercise

gh secret set 으로 아빠 프로젝트에 repo secret 한 개 추가. Workflow step 의 env: 에서 참조. Run log 에서 값이 redact 되었는지 확인 (*** 로 표시) — plaintext 절대 안 보여야 함.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.