简体   繁体   English

Github 操作 - 如何使用 Github API 下载工作流日志?

[英]Github actions - How to Download the workflow logs using Github API?

I am trying to get the build logs when the workflow is finished.我正在尝试在工作流程完成后获取构建日志。 I have followed this documentaion .我已经关注了这个文档 But I am getting the following error:但我收到以下错误:

"message": "Not Found",
"documentation_url": "https://docs.github.com/rest"

I don't know what I did wrong here.我不知道我在这里做错了什么。 someone guide me on how I can download the logs.有人指导我如何下载日志。

Workflow.yml:工作流.yml:

name: Get logs

on: push

jobs:
  build:
    runs-on: ubuntu-latest
    name: get workflow logs
    permissions:
      actions: read
    steps:
    - name: Hello World
      id: helloresponse
      run: echo Hello, world!

    - name: create log
      if: always()
      id: createlog
      run: |
        curl --request GET \
          -H "Accept: application/vnd.github.v3+json" \
          --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
          --header 'content-type: application/json' \
          https://api.github.com/repos/${{github.owner}}/${{github.repository}}/actions/runs/${{ github.run_id }}/log

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 github 下载 github 操作工作流日志 api - Downloading github actions workflow logs using github api 如何查看 GitHub 操作的完整日志(无需重新启动或取消工作流程)? - How to see full logs on GitHub Actions (without restarting or cancelling workflow)? 使用 API 在工作流运行/github 操作之间共享工作流工件 - Share workflow artifacts between workflow runs / github actions using the API 使用 Octokit API 从 GitHub Actions 获取最新的工作流程 - Get the latest workflow run from GitHub Actions using the Octokit API 如何使用 GitHub Actions 下载存档的 GitHub Release 源代码 - how to download the archived GitHub Release Source code using GitHub Actions Github:从任何存储库的 Github 操作工作流程下载工件 - Github: Download artifact from any repository's Github actions workflow 如何使用 github 操作从 Github 中的存储库 A 的工作流作业触发存储库 B(下游作业)中的工作流作业 - How to trigger a workflow job in repository B(downstream job) from workflow job of repository A in Github using github actions github 操作中的工作流描述 - Description for a workflow in github actions 如何使用 Github 操作 ZDB974238714CA8DE634A7CE1D08 获取 Github 工作流 yaml 文件 - How to fetch Github workflows yaml files using Github Actions API 使用 github 操作自动化 flutter 工作流程 - Automate flutter workflow using github actions
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM