GitHub Actions 실행 중 발생한 "remote: Write access to repository not granted." 오류는 푸시 권한이 없어서 발생합니다.
오류 메세지는 다음과 같습니다.
Run git add . [main e0f1c9c] Update
- 1 file changed, 1 insertion(+) create mode 100644 /2025-03-24.json
remote: Write access to repository not granted.
fatal: unable to access 'https://github.com/~/': The requested URL returned error: 403
Error: Process completed with exit code 128.
원인
- GitHub Actions에서 사용한 인증 정보가 푸시 권한이 없음
- 기본적으로 GITHUB_TOKEN은 푸시 권한이 없을 수 있음
- Personal Access Token (PAT) 필요.
- GitHub Actions 실행 주체가 저장소에 대한 푸시 권한이 없음
- 예를 들어, fork된 저장소에서 실행 중이라면 원본 저장소에 푸시할 권한이 없음
해결 방법
GitHub Actions 설정에서 권한을 수정합니다.
- 저장소 Settings Actions General로 이동
- Workflow permissions 섹션에서 "Read and write permissions" 선택 "Save" 클릭