Git Action显示Permission Denied:尝试读取JSON文件时出错

huangapple go评论71阅读模式
英文:

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 &#39;/home/runner/work/&lt;Test&gt;/&lt;Test&gt;/test.json&#39;

I get the following error code:

/home/runner/work/_temp/********-***-***-***-*********.sh: line 1: /home/runner/work/&lt;Test&gt;/&lt;Test&gt;/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.

huangapple
  • 本文由 发表于 2023年2月23日 19:49:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/75544442.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定