致命:不安全的存储库归别人所有-Github Actions Workflow
我在GitHub操作中配置了两个YML文件。当将新代码推向主机时,一个YML文件将文件部署到特定的网站文件夹,另一个文件将文件部署到另一个网站文件夹。 即使两个网站都在同一台服务器上,但其中一个Deploy.yml文件没有执行作业,而是引发了此错误。
fatal: unsafe repository ('/var/www/yayyy.net/public_html' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory /var/www/yyyy.net/public_html
Error: Process completed with exit code 128.
在此步骤中:
- name: Add temp repo access
run: |
cd $DEV_WEBSITE_PATH
git remote set-url origin https://anything:${{ secrets.GITHUB_TOKEN }}@github.com/yyyyy/website.git
我尝试在此步骤之前添加额外的步骤并添加此SAFE.DIRECTORY命令,但随后显示了拒绝错误。
error: could not lock config file /var/www/.gitconfig: Permission denied
添加sudo然后在命令引发此错误之前:
sudo: sorry, you must have a tty to run sudo
我很困惑我缺少什么,您能帮忙吗?
I have two yml files configured in the GitHub actions. When new code is pushed to master, one yml file deploys the files to specific website folder, and the other one to another website folder.
Even though both websites are on the same server, one of the deploy.yml files is not executing jobs and it's throwing this error.
fatal: unsafe repository ('/var/www/yayyy.net/public_html' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory /var/www/yyyy.net/public_html
Error: Process completed with exit code 128.
at this step:
- name: Add temp repo access
run: |
cd $DEV_WEBSITE_PATH
git remote set-url origin https://anything:${{ secrets.GITHUB_TOKEN }}@github.com/yyyyy/website.git
I tried adding extra step before that step and added this safe.directory command but then it's showing permission denied error.
error: could not lock config file /var/www/.gitconfig: Permission denied
Adding sudo before the command then throws this error:
sudo: sorry, you must have a tty to run sudo
I'm confused what I'm missing, can you help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
.gitConfig不存在,
用户名
毫无权限来创建它。因此,我手动创建了它,并将所有权更改为用户名
。The.gitconfig did not exist and the
username
didn't have permission to create it. So, I created it manually and changed ownership to theusername
.