【完美解决】Github action报错remote: Write access to repository not granted.

简介: 【完美解决】Github action报错remote: Write access to repository not granted.

报错及效果图

本解决方案是笔者通过Github action运行项目时报错的解决方案,如果是本地运行报此错,未必有效果。

报错代码

remote: Write access to repository not granted.
fatal: unable to access 'https://github.com/xxx/xxx/': The requested URL returned error: 403
Error: Process completed with exit code 128.

效果图

在经历N多次尝试后,终于绿了

最终效果

解决方案

必要步骤

替换之后打开此链接:https://github.com/xxx/yyy/settings/actions

xxx替换为自己GitHub的用户名,yyy替换为自己仓库的名字

当然也可以直接在该仓库中选择Settings,然后左侧选择Actions,选择General。

拖到下面找到Workflow permissions,按下图示选择,完成后点save即可

拖到下面找到Workflow permissions,按下图示选择,完成后点save即可

可能有效的步骤

因为我运行的代码里有

 git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}

所以需要添加token

添加方式:通过此链接打开如图所示界面,当然也可以按照左上角黄框路径来选择。


点击Generate new token

这些随便填

这个根据实际情况,我选的该项目



Permissions这里要注意修改此项:


下面此项可能有用,第一遍弄得时候改了access,懒得弄第二遍测试了 为保一次成功,最好弄上。


然后下面generate token即可。

相关文章
|
1天前
|
Shell 网络安全 开发工具
fatal: unable to access 'https://github.com/wolfcw/libfaketime.git/': Encountered end of file
fatal: unable to access 'https://github.com/wolfcw/libfaketime.git/': Encountered end of file
|
1月前
|
Linux C++ Docker
【Azure Developer】在Github Action中使用Azure/functions-container-action@v1配置Function App并成功部署Function Image
【Azure Developer】在Github Action中使用Azure/functions-container-action@v1配置Function App并成功部署Function Image
|
1月前
|
数据安全/隐私保护
【Azure Developer】Github Action使用Azure/login@v1插件登录遇见错误的替代方案
【Azure Developer】Github Action使用Azure/login@v1插件登录遇见错误的替代方案
|
1月前
|
存储
【Azure Developer】Github Action部署资源(ARM模板)到Azure中国区时,遇见登录问题的解决办法
【Azure Developer】Github Action部署资源(ARM模板)到Azure中国区时,遇见登录问题的解决办法
|
1月前
|
存储 开发工具 数据安全/隐私保护
解决Gitee或者Github出现Access denied fatal: unable to access,The requested URL returned error: 403
解决Gitee或者Github出现Access denied fatal: unable to access,The requested URL returned error: 403
146 0
|
1月前
GitHub——如何生成Personal access tokens
GitHub——如何生成Personal access tokens
10 0
|
2月前
|
网络安全 开发工具 git
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
567 1
|
2月前
|
机器学习/深度学习 人工智能 分布式计算
人工智能平台PAI操作报错合集之引用github.com/alibaba/pairec包时报错,该如何解决
阿里云人工智能平台PAI是一个功能强大、易于使用的AI开发平台,旨在降低AI开发门槛,加速创新,助力企业和开发者高效构建、部署和管理人工智能应用。其中包含了一系列相互协同的产品与服务,共同构成一个完整的人工智能开发与应用生态系统。以下是对PAI产品使用合集的概述,涵盖数据处理、模型开发、训练加速、模型部署及管理等多个环节。
|
3月前
|
数据安全/隐私保护 开发者 Docker
国内docker公开镜像站的关闭!别急,docker_image_pusher 使用Github Action将国外的Docker镜像转存到阿里云私有仓库
通过使用 docker_image_pusher 这样的开源项目,我们能够轻松地解决国内访问 Docker 镜像拉取速度慢及拉去失败的问题,同时保证了镜像的稳定性和安全性。利用 Github Action 的自动化功能,使得这一过程更加简单和高效。
1444 2
|
2月前
|
网络安全 开发工具 git
使用git克隆仓库报错:Warning: Permanently added‘github.com’ to the .....(ssh )
所以,你可以安全地忽略这个警告,它不会影响到你使用git克隆仓库。如果你已经成功克隆了仓库,那么一切都在正常工作。如果你在克隆过程中遇到其他问题,那可能需要查看具体的错误信息来解决。
51 0