[英]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
I think the endpoint ends with logs
not log
我认为端点以
logs
而不是log
结束
https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-logs https://docs.github.com/en/rest/actions/workflow-runs#download-workflow-run-logs
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.