자동 발급 runner ID
모든 workflow run 은 자동 발급 GITHUB_TOKEN 받아. 현재 repo 에 scope 된 runner 의 installation token. PAT 발급 없이 GitHub API 호출용.
${{ secrets.GITHUB_TOKEN }} 또는 ${{ github.token }} 로 사용. Run 동안만 살고 만료.
기본 권한은 너무 관대
2023 까지 GITHUB_TOKEN 은 대부분에 write default (contents, issues, pull-requests). 이제 org default 는 'permissive' (legacy) 나 'restricted' (read all) 둘 중. 항상 확인하고 restricted 선호.
Workflow 별 permissions: 로 scope:
contents: read— checkout, push 없음.contents: write— commit, tag, release push.pull-requests: write— PR 코멘트, PR 생성.issues: write— issue 코멘트.id-token: write— OIDC token 요청 (다음 lesson).packages: write— GHCR 에 push.security-events: write— code scanning 위한 SARIF 업로드.