nerdexam
Microsoft

GH-200 · Question #3

You need to make a script to retrieve workflow run logs via the API. Which is the correct API to download a workflow run log?

The correct answer is B. GET /repos/:owner/:repo/actions/runs/:run_id/logs. REST API endpoints for workflow jobs You can use the REST API to view logs and workflow jobs in GitHub Actions. Download job logs for a workflow run Gets a redirect URL to download a plain text file of logs for a workflow job. Code samples for "Download job logs for a workflow…

Implement and manage GitHub Actions workflows

Question

You need to make a script to retrieve workflow run logs via the API. Which is the correct API to download a workflow run log?

Options

  • APOST /repos/:owner/:repo/actions/runs/:run_id/logs
  • BGET /repos/:owner/:repo/actions/runs/:run_id/logs
  • CPOST /repos/:owner/:repo/actions/runs/:run_id
  • DGET /repos/:owner/:repo/actions/artifacts/logs

How the community answered

(28 responses)
  • A
    4% (1)
  • B
    93% (26)
  • C
    4% (1)

Explanation

REST API endpoints for workflow jobs You can use the REST API to view logs and workflow jobs in GitHub Actions. Download job logs for a workflow run Gets a redirect URL to download a plain text file of logs for a workflow job. Code samples for "Download job logs for a workflow run" Get /repos/{owner}/{repo}/actions/jobs/{job_id}/logs https://docs.github.com/en/rest/actions/workflow-jobs

Topics

#GitHub API#Workflow Logs#REST API#API Endpoints

Community Discussion

No community discussion yet for this question.

Full GH-200 Practice