현상: github action이 아래와 같은 에러와 함께 시작되지 않음
원인: GitHub Actions의 actions/cache 버전 문제. actions/cache: v4.0.1이 더 이상 지원되지 않기 때문에, 워크플로우에서 이를 v3 또는 최신 v4로 업데이트해야 함
해결
- name: Terraform Plugin Cache
uses: actions/[email protected] -> @v4 로 변경
현상: self-hosted github action에서 git push 명령어 실행시 발생한 에러
원인: self-hosted runner가 root 권한으로 실행중인데 .git 폴더에 대한 권한이 없음
해결: push하기 전 아래 step 추가
- name: Grant permission
run: |
sudo chown -R $(whoami) .git/objects
sudo chmod -R 755 .git/objects
현상: github action으로 tag생성 test하다가 꼬였는데 브랜치에 push도 안되고 브랜치 삭제 후, 다시 만들어도 안됨. 레포 자체를 삭제하고 다시 만들어도 안됨
해결
git push -d origin <문제의 브랜치명>
원인: 브랜치는 폴더가 아니라 분기이며 분기 b가 존재하는 경우 b/something같은 그 하위 분기는 생성할 수 없음
해결: 관련 브랜치와 브랜치 로그 폴더들을 삭제 참고
# remotes 제거
sudo rm -rf .git/refs/remotes/origin/<브랜치명>
sudo rm -rf .git/logs/refs/remotes/origin/<브랜치명>
# heades 제거
sudo rm -rf .git/refs/heads/<브랜치명>
sudo rm -rf .git/logs/refs/heads/<브랜치명>
error: cannot open .git/FETCH_HEAD: Permission denied 에러 발생