【完美解决】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月前
|
安全 网络安全 数据安全/隐私保护
解决SSH测试连接GitHub时出现“connection closed by remote host”的问题。
然后使用 `ssh -T git@ssh.github.com`来测试连接。
169 0
|
3月前
|
网络协议 开发工具 git
解决 git 报错 “fatal: unable to access ‘https://github.com/.../.git‘: Recv failure Connection was rese
在使用 Git/Git小乌龟 进行代码管理的过程中,经常会遇到各种各样的问题,其中之一就是在执行 git clone 或 git pull 等操作时出现 “fatal: unable to access ‘https://github.com/…/.git’: Recv failure Connection was reset” 的报错。这个问题通常是由网络连接问题或代理设置不正确导致的。在我的个人使用经验中,我亲自尝试了四种方法,它们都能够有效地解决这个报错。个人比较推荐方法二。
1522 0
|
6月前
|
存储 运维 安全
Github Action:让静态网站实现定时发布
本文探讨了静态网站实现定时发布的解决方案,针对静态博客缺乏原生定时发布功能的问题,作者基于Zola工具构建的静态网站,最终选择通过GitHub Action实现定时发布。文章对比了几种实现方式,包括人力、自建服务及平台原生功能等,指出最理想的是利用平台能力但多数平台缺乏该功能。文中详细介绍了GitHub Action方案的原理、部署过程和使用流程,并分享了高级配置如推送通知。同时分析了方案的局限性,如时间颗粒度粗、设置繁琐等,并提出改进建议。总结中展望了未来优化方向,旨在提升静态网站维护体验。
92 0
|
11月前
|
对象存储
一个通过 GitHub Action 将 GitHub 仓库与阿里云 OSS 完全同步的脚本
一种将 GitHub 仓库完全同步到阿里云 OSS 的方法。
|
11月前
|
数据安全/隐私保护
github报错(完美解决):获取token。remote: Support for password authentication was removed on August 13, 2021.
这篇文章介绍了如何在GitHub上解决因密码认证被移除而导致的推送错误,通过创建和使用个人访问令牌(token)来代替密码进行身份验证。
2221 0
|
12月前
|
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
github下载的.ipynb文件报错unreadable Notebook NotJSONError
【8月更文挑战第2天】文章提供了解决GitHub下载的Jupyter Notebook文件打开时报错的方法,包括端口冲突和文件加载错误。
303 0
github下载的.ipynb文件报错unreadable Notebook NotJSONError
|
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
|
数据安全/隐私保护
【Azure Developer】Github Action使用Azure/login@v1插件登录遇见错误的替代方案
【Azure Developer】Github Action使用Azure/login@v1插件登录遇见错误的替代方案
132 0
|
存储
【Azure Developer】Github Action部署资源(ARM模板)到Azure中国区时,遇见登录问题的解决办法
【Azure Developer】Github Action部署资源(ARM模板)到Azure中国区时,遇见登录问题的解决办法
123 0

热门文章

最新文章