Bug? Incorrect Action Status

The API reports: "state": "pending" (https://api.github.com/repos/osbdr/pipeline-django-demo/commits/2e7491f5f28b3e64ef5f411ba257cea2f9a81219/status)

But the UI shows: passed (https://github.com/osbdr/pipeline-django-demo/pull/18/checks)

It seems like when there is a skipped job, the state reported by the API is incorrect, or am I missing something?

:wave: hello there @j0nm1, and welcome to the GitHub Support Community! :tada:

It seems like when there is a skipped job, the state reported by the API is incorrect, or am I missing something?

Great question! There are two types of status checks on GitHub:

  • Checks (a top-level term that refers to both check suites and check runs)
  • Statuses

Checks are different from statuses in that they provide line annotations, more detailed messaging, and are only available for use with GitHub Apps.

Making a request to https://api.github.com/repos/osbdr/pipeline-django-demo/commits/2e7491f5f28b3e64ef5f411ba257cea2f9a81219/status will return the combined status for a specific reference. This is a status, not a check.

I checked out https://github.com/osbdr/pipeline-django-demo/pull/18/checks and see that the UI renders the result of whatever GitHub Actions created when the following workflows were triggered:

Internally, GitHub Actions uses the Checks API to create a check suite for each workflow run and creates a check run for each workflow job.

Our Checks API has endpoints for making a request to get a check suite and to get a check run respectively.

Putting it together, here’s an example curl request: that makes a request to the API to return the following check run:

curl --verbose \
  -H "Accept: application/vnd.github.antiope-preview+json" \
  "https://api.github.com/repos/osbdr/pipeline-django-demo/check-runs/820065557"
Response
{
  "id": 820065557,
  "node_id": "MDg6Q2hlY2tSdW44MjAwNjU1NTc=",
  "head_sha": "2e7491f5f28b3e64ef5f411ba257cea2f9a81219",
  "external_id": "3ff1c74c-5f34-5022-6698-efa595f88d8d",
  "url": "https://api.github.com/repos/osbdr/pipeline-django-demo/check-runs/820065557",
  "html_url": "https://github.com/osbdr/pipeline-django-demo/runs/820065557",
  "details_url": "https://github.com/osbdr/pipeline-django-demo/runs/820065557",
  "status": "completed",
  "conclusion": "success",
  "started_at": "2020-06-29T21:08:06Z",
  "completed_at": "2020-06-29T21:09:45Z",
  "output": {
    "title": null,
    "summary": null,
    "text": null,
    "annotations_count": 0,
    "annotations_url": "https://api.github.com/repos/osbdr/pipeline-django-demo/check-runs/820065557/annotations"
  },
  "name": "build (3.7, macos-latest)",
  "check_suite": {
    "id": 855759002
  },
  "app": {
    "id": 15368,
    "slug": "github-actions",
    "node_id": "MDM6QXBwMTUzNjg=",
    "owner": {
      "login": "github",
      "id": 9919,
      "node_id": "MDEyOk9yZ2FuaXphdGlvbjk5MTk=",
      "avatar_url": "https://avatars1.githubusercontent.com/u/9919?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/github",
      "html_url": "https://github.com/github",
      "followers_url": "https://api.github.com/users/github/followers",
      "following_url": "https://api.github.com/users/github/following{/other_user}",
      "gists_url": "https://api.github.com/users/github/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/github/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/github/subscriptions",
      "organizations_url": "https://api.github.com/users/github/orgs",
      "repos_url": "https://api.github.com/users/github/repos",
      "events_url": "https://api.github.com/users/github/events{/privacy}",
      "received_events_url": "https://api.github.com/users/github/received_events",
      "type": "Organization",
      "site_admin": false
    },
    "name": "GitHub Actions",
    "description": "Automate your workflow from idea to production",
    "external_url": "https://help.github.com/en/actions",
    "html_url": "https://github.com/apps/github-actions",
    "created_at": "2018-07-30T09:30:17Z",
    "updated_at": "2019-12-10T19:04:12Z",
    "permissions": {
      "actions": "write",
      "checks": "write",
      "contents": "write",
      "deployments": "write",
      "issues": "write",
      "metadata": "read",
      "packages": "write",
      "pages": "write",
      "pull_requests": "write",
      "repository_hooks": "write",
      "repository_projects": "write",
      "security_events": "write",
      "statuses": "write",
      "vulnerability_alerts": "read"
    },
    "events": [
      "check_run",
      "check_suite",
      "create",
      "delete",
      "deployment",
      "deployment_status",
      "fork",
      "gollum",
      "issues",
      "issue_comment",
      "label",
      "milestone",
      "page_build",
      "project",
      "project_card",
      "project_column",
      "public",
      "pull_request",
      "pull_request_review",
      "pull_request_review_comment",
      "push",
      "registry_package",
      "release",
      "repository",
      "repository_dispatch",
      "status",
      "watch",
      "workflow_dispatch",
      "workflow_run"
    ]
  },
  "pull_requests": [

  ]
}

Passing in the custom application/vnd.github.antiope-preview+json media type in the request is required to access the Checks API, per this preview notice. I hope this helps!