Github操作机器人推送到gh页面会导致页面生成失败
我有一个github repo,在那里我设置了github操作来自动构建文档并将其推送到Github操作机器人推送到gh页面会导致页面生成失败,github,github-pages,github-actions,Github,Github Pages,Github Actions,我有一个github repo,在那里我设置了github操作来自动构建文档并将其推送到gh页面分支 ,所有内容都会找到,包括推送更新,这是通过以下两行完成的: git -c user.email=<hidden from question> -c user.name="${GITHUB_ACTOR}" commit -m "Github Action-built docs update" git push "https://${GITHUB_ACTOR}:${{ secrets.G
gh页面
分支
,所有内容都会找到,包括推送更新,这是通过以下两行完成的:
git -c user.email=<hidden from question> -c user.name="${GITHUB_ACTOR}" commit -m "Github Action-built docs update"
git push "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git" HEAD:gh-pages
那么为什么会发生这种情况呢?我怎样才能修好它
我已经成功地从github API获得了页面构建。以下是失败的生成:
{
"url": "https://api.github.com/repos/Cimbali/pympress/pages/builds/152994257",
"status": "errored",
"error": {
"message": "Page build failed."
},
"pusher": {
"login": "github-actions[bot]",
"id": <some integer>,
"node_id": "<some base 64 value>",
"avatar_url": "https://avatars2.githubusercontent.com/in/15368?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
<[...]>
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
"type": "Bot",
"site_admin": false
},
"commit": null,
"duration": 29,
"created_at": "2019-11-17T16:55:03Z",
"updated_at": "2019-11-17T16:55:03Z"
}
{
“url”:”https://api.github.com/repos/Cimbali/pympress/pages/builds/152994257",
“状态”:“出错”,
“错误”:{
“消息”:“页面生成失败。”
},
“推动者”:{
“登录”:“github操作[bot]”,
“id”:,
“节点id”:“”,
“头像url”:https://avatars2.githubusercontent.com/in/15368?v=4",
“gravatar_id”:“,
“url”:”https://api.github.com/users/github-actions%5Bbot%5D",
“收到的\u事件\u url”:https://api.github.com/users/github-actions%5Bbot%5D/received_events",
“类型”:“Bot”,
“站点管理”:false
},
“提交”:空,
“期限”:29,
“创建时间”:“2019-11-17T16:55:03Z”,
“更新时间”:“2019-11-17T16:55:03Z”
}
下面是接下来的(手动触发的)成功构建的比较:
{
"url": "https://api.github.com/repos/Cimbali/pympress/pages/builds/152998876",
"status": "built",
"error": {
"message": null
},
"pusher": {
"login": "Cimbali",
"id": <some integer>,
"node_id": "<a different base 64 value>",
"avatar_url": "https://avatars2.githubusercontent.com/u/6126377?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cimbali",
<[...]>
"received_events_url": "https://api.github.com/users/Cimbali/received_events",
"type": "User",
"site_admin": false
},
"commit": "b87d18729c945002566bae920361b2bd6bc43be6",
"duration": 10306,
"created_at": "2019-11-17T17:46:09Z",
"updated_at": "2019-11-17T17:46:20Z"
}
{
“url”:”https://api.github.com/repos/Cimbali/pympress/pages/builds/152998876",
“状态”:“已建立”,
“错误”:{
“消息”:空
},
“推动者”:{
“登录”:“Cimbali”,
“id”:,
“节点id”:“”,
“头像url”:https://avatars2.githubusercontent.com/u/6126377?v=4",
“gravatar_id”:“,
“url”:”https://api.github.com/users/Cimbali",
“收到的\u事件\u url”:https://api.github.com/users/Cimbali/received_events",
“类型”:“用户”,
“站点管理”:false
},
“提交”:“b87d18729c945002566bae920361b2bd6bc43be6”,
“持续时间”:10306,
“创建时间”:“2019-11-17T17:46:09Z”,
“更新时间”:“2019-11-17T17:46:20Z”
}
我在评论中提出的建议似乎有效,即使用repo
作用域,而不是默认的GITHUB\u令牌
GitHub支持部门的一封电子邮件确认,GitHub\u令牌不起作用是故意行为
推送到存储库的bot用户或集成无法触发GitHub页面站点构建。这是为了防止GitHub页面系统的过度资源使用和滥用
这看起来可能是个bug。您是否尝试过使用repo
作用域而不是GITHUB\u令牌
?GITHUB通过电子邮件确认了这一意图:«GITHUB页面站点构建无法由推送到您的存储库的bot用户或集成触发。这是为了防止GitHub页面系统的过度资源使用和滥用。»很高兴知道!更新了答案。
{
"url": "https://api.github.com/repos/Cimbali/pympress/pages/builds/152998876",
"status": "built",
"error": {
"message": null
},
"pusher": {
"login": "Cimbali",
"id": <some integer>,
"node_id": "<a different base 64 value>",
"avatar_url": "https://avatars2.githubusercontent.com/u/6126377?v=4",
"gravatar_id": "",
"url": "https://api.github.com/users/Cimbali",
<[...]>
"received_events_url": "https://api.github.com/users/Cimbali/received_events",
"type": "User",
"site_admin": false
},
"commit": "b87d18729c945002566bae920361b2bd6bc43be6",
"duration": 10306,
"created_at": "2019-11-17T17:46:09Z",
"updated_at": "2019-11-17T17:46:20Z"
}