英文:
Git Action showing Permission Denied: I have an error when trying to read a JSON file
问题
Git Action显示权限被拒绝:尝试读取JSON文件时出现错误。
运行
./src/script.sh '/home/runner/work/<Test>/<Test>/test.json'
我收到以下错误代码:
/home/runner/work/_temp/********-***-***-***-*********.sh:第1行:/home/runner/work/<Test>/<Test>/test.json:权限被拒绝
错误:进程以退出码126完成。
我需要添加哪些权限?
英文:
Git Action showing Permission Denied: I have an error when trying to read a JSON file.
Running
./src/script.sh '/home/runner/work/<Test>/<Test>/test.json'
I get the following error code:
/home/runner/work/_temp/********-***-***-***-*********.sh: line 1: /home/runner/work/<Test>/<Test>/test.json: Permission denied
Error: Process completed with exit code 126.
What permissions do I need to add?
答案1
得分: 0
使用ls -l /path/to/file
命令显示,正如上面的注释所解释的那样,该文件具有读取权限(-rw-r--r--
)。
使用chmod -x
命令来更新本地文件系统权限集,并将带有更新权限的文件推送回存储库,问题得以解决。
英文:
As explained in the comments above, using the ls -l /path/to/file
command showed that the file had reading permissions (-rw-r--r--
).
Using the chmod -x
command to update the filesystem permission set locally, and pushing the file back with the updated permission to the repository resolved the issue.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论