
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
一个用于https://github.com/hhatto/autopep8%E7%9A%84GitHub Action,autopep8是一个自动格式化Python代码以符合PEP 8风格指南的工具。
此Action旨在与https://github.com/peter-evans/create-pull-request%E9%85%8D%E5%90%88%E4%BD%BF%E7%94%A8%EF%BC%8C%E5%8F%AF%E8%87%AA%E5%8A%A8%E5%88%9B%E5%BB%BA%E6%8B%89%E5%8F%96%E8%AF%B7%E6%B1%82%EF%BC%8C%E5%90%88%E5%B9%B6autopep8%E5%AF%B9%E4%BB%93%E5%BA%93%E4%B8%ADPython%E4%BB%A3%E7%A0%81%E6%89%80%E5%81%9A%E7%9A%84%E4%BF%AE%E5%A4%8D%E3%80%82
此Action是https://github.com/hhatto/autopep8%E7%9A%84%E7%AE%80%E5%8D%95%E5%8C%85%E8%A3%85%E5%99%A8%E3%80%82%E5%BA%94%E9%80%9A%E8%BF%87%60args%60%E5%8F%82%E6%95%B0%E5%90%91Action%E4%BC%A0%E9%80%92%E5%8F%82%E6%95%B0%E3%80%82%E4%BB%A5%E4%B8%8B%E7%A4%BA%E4%BE%8B%E4%BD%BF%E7%94%A8%E6%BF%80%E8%BF%9B%E7%BA%A7%E5%88%AB2%E4%BF%AE%E5%A4%8D%E4%BB%93%E5%BA%93%E4%B8%AD%E7%9A%84%E6%89%80%E6%9C%89Python%E6%96%87%E4%BB%B6%E3%80%82
yml- name: autopep8 id: autopep8 uses: peter-evans/autopep8@v2 with: args: --recursive --in-place --aggressive --aggressive .
Action会输出autopep8的退出码。结合autopep8的--exit-code标志,这在拉取请求检查中很有用。
yml- name: Fail if autopep8 made changes if: steps.autopep8.outputs.exit-code == 2 run: exit 1
有关更多参数详情,请参见https://github.com/hhatto/autopep8%E3%80%82
单独使用此Action价值不大。请将其与https://github.com/peter-evans/create-pull-request%E6%88%96%E7%9B%B4%E6%8E%A5%E6%8E%A8%E9%80%81%E5%88%B0%E5%88%86%E6%94%AF%E5%B7%A5%E4%BD%9C%E6%B5%81%E9%85%8D%E5%90%88%E4%BD%BF%E7%94%A8%E3%80%82
以下工作流是一个简单示例,演示两个Action如何协同工作。
ymlname: Format python code on: push jobs: autopep8: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: autopep8 uses: peter-evans/autopep8@v2 with: args: --recursive --in-place --aggressive --aggressive . - name: Create Pull Request uses: peter-evans/create-pull-request@v3 with: commit-message: autopep8 action fixes title: Fixes by autopep8 action body: This is an auto-generated PR with fixes by autopep8. labels: autopep8, automated pr reviewers: peter-evans branch: autopep8-patches
此配置将创建如下所示的拉取请求:
!https://github.com/peter-evans/autopep8/blob/master/autopep8-example-pr.png?raw=true
更新:虽然以下方法在某些情况下有效,但强烈建议对拉取请求操作使用斜杠命令风格的"ChatOps"解决方案。有关此类解决方案,请参见https://github.com/peter-evans/slash-command-dispatch%E3%80%82
以下是一个工作流示例,适用于autopep8既作为拉取请求检查运行,又提出进一步拉取请求以应用修复的场景。
工作原理:
注意,由于https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token%EF%BC%8C%E6%AD%A4%E5%B7%A5%E4%BD%9C%E6%B5%81%E4%B8%8D%E9%80%82%E7%94%A8%E4%BA%8E%E4%BB%8E%E5%88%86%E6%94%AF%E6%8F%90%E5%87%BA%E7%9A%84%E6%8B%89%E5%8F%96%E8%AF%B7%E6%B1%82%E3%80%82%E7%A7%81%E6%9C%89%E4%BB%93%E5%BA%93%E5%8F%AF%E4%BB%A5%E9%85%8D%E7%BD%AE%E4%B8%BAhttps://docs.github.com/en/github/administering-a-repository/disabling-or-limiting-github-actions-for-a-repository#enabling-workflows-for-private-repository-forks%E4%B8%8D%E5%8F%97%E9%99%90%E5%88%B6%E5%9C%B0%E8%BF%90%E8%A1%8C%E3%80%82
ymlname: autopep8 on: pull_request jobs: autopep8: # 检查PR是否不由此工作流提出且不是来自分支 if: startsWith(github.head_ref, 'autopep8-patches') == false && github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: ref: ${{ github.head_ref }} - name: autopep8 id: autopep8 uses: peter-evans/autopep8@v2 with: args: --exit-code --recursive --in-place --aggressive --aggressive . - name: Set autopep8 branch name id: vars run: | branch-name="autopep8-patches/${{ github.head_ref }}" echo "branch-name=$branch-name" >> $GITHUB_OUTPUT - name: Create Pull Request if: steps.autopep8.outputs.exit-code == 2 uses: peter-evans/create-pull-request@v3 with: commit-message: autopep8 action fixes title: Fixes by autopep8 action body: This is an auto-generated PR with fixes by autopep8. labels: autopep8, automated pr reviewers: peter-evans branch: ${{ steps.vars.outputs.branch-name }} - name: Fail if autopep8 made changes if: steps.autopep8.outputs.exit-code == 2 run: exit 1
以下工作流是上述工作流的替代方案。它不提出第二个拉取请求,而是将autopep8所做的更改直接提交到拉取请求分支。
重要警告:如果除以下工作流外还有其他拉取请求检查,则必须使用https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token%E8%80%8C%E9%9D%9E%E9%BB%98%E8%AE%A4%E7%9A%84%60GITHUB_TOKEN%60%E3%80%82%E8%BF%99%E6%98%AF%E7%94%B1%E4%BA%8EGitHub Actions故意施加的限制,即工作流引发的事件(如push)不能触发进一步的工作流运行。这是为了防止意外的"无限循环"情况,并作为反滥用措施。使用repo作用域的https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token%E6%98%AF%E4%B8%80%E7%A7%8D%E8%AE%A4%E5%8F%AF%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95%E3%80%82%E8%AF%A6%E8%A7%81https://github.com/peter-evans/create-pull-request/blob/master/docs/concepts-guidelines.md#triggering-further-workflow-runs%E3%80%82
工作原理:
push触发所有拉取请求检查再次运行。注意,由于https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token%EF%BC%8C%E6%AD%A4%E5%B7%A5%E4%BD%9C%E6%B5%81%E4%B8%8D%E9%80%82%E7%94%A8%E4%BA%8E%E4%BB%8E%E5%88%86%E6%94%AF%E6%8F%90%E5%87%BA%E7%9A%84%E6%8B%89%E5%8F%96%E8%AF%B7%E6%B1%82%E3%80%82%E7%A7%81%E6%9C%89%E4%BB%93%E5%BA%93%E5%8F%AF%E4%BB%A5%E9%85%8D%E7%BD%AE%E4%B8%BAhttps://docs.github.com/en/github/administering-a-repository/disabling-or-limiting-github-actions-for-a-repository#enabling-workflows-for-private-repository-forks%E4%B8%8D%E5%8F%97%E9%99%90%E5%88%B6%E5%9C%B0%E8%BF%90%E8%A1%8C%E3%80%82
ymlname: autopep8 on: pull_request jobs: autopep8: # 检查PR是否不是来自分支 if: github.event.pull_request.head.repo.full_name == github.repository runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: token: ${{ secrets.REPO_ACCESS_TOKEN }} ref: ${{ github.head_ref }} - name: autopep8 id: autopep8 uses: peter-evans/autopep8@v2 with: args: --exit-code --recursive --in-place --aggressive --aggressive . - name: Commit autopep8 changes if: steps.autopep8.outputs.exit-code == 2 run: | git config --global user.name 'Peter Evans' git config --global user.email 'peter-evans@users.noreply.github.com' git commit -am "Automated autopep8 fixes" git push
MIT许可证 - 详见LICENSE文件。
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。






来自真实用户的反馈,见证轩辕镜像的优质服务