ある日突然CIが動かなくなった
このCI自体はこのブログシステムのJAMStackアーキテクチャ内で利用していて、ブログシステムのアップデートと記事の更新によるトリガでCIが動くような仕組みになっている。
triggerと書かれたworkflow runが記事の更新によるものでソースコードについては編集を加えていないため、CIが動作しなくなるのはなにかのライブラリのはず ということで調査を行った
失敗したCIのログがこちら
エラーが出ているActionはこちら
⬆️ Push changes made by actions right back into the current repository. - actions-js/push...
github.com
Run actions-js/push@master
with:
github_token: ***
author_email: github-actions[bot]@users.noreply.github.com
author_name: github-actions[bot]
branch: main
directory: .
Started: bash /home/runner/work/_actions/actions-js/push/master/start.sh
Push to branch main
[master 856abcb] chore: autopublish 2021-08-08T14:39:20Z
(中略)
To https://github.com/utautattaro/xxxxxxxx.git
! [rejected] HEAD -> main (fetch first)
error: failed to push some refs to 'https://github.com/utautattaro/xxxxxxxx.git'
原因はbranch: main
の箇所
ドキュメントを読んでみると、Inputsの中のbranchはデフォルトで'master'を参照していると書いてあったのだが、Destination branch to push changes とあるので、デフォルトブランチを参照するという意味とも取れる。ややこしい。
まだ自分の管理しているリポジトリではmasterからmainへの移行がすすんでいなかったため起きたエラーだった。以下のように修正し、問題なく動作することが確認できた。
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: 'master' #追加