参考
why-when-i-use-github-actions-ci-for-a-gradle-project-i-face-gradlew-permiss
问题描述
由于在 Windows 环境下写脚本时对权限问题不太敏感,并没有为仓库中的脚本赋予执行权限,因此在 actions 执行过程中报了以下错误
/home/runner/work/_temp/35b69792-52fd-48f2-9411-ec8be68d25ef.sh: line 1: /home/runner/work/bark-action/bark-action/.//script.sh: Permission denied
Error: Process completed with exit code 126.
原因是因为 script.sh
没有执行权限
解决方法
使用 --chmod=(+|-)x
--chmod=(+|-)x
Set the execute permissions on the updated files.
为仓库中的脚本赋予执行权限
git update-index --chmod=+x script.sh
commit 并 push 后,问题就解决了