Clivern / Hamster

🐀 A Bot toolkit for github that supports OAuth, Events, API, Custom Commands and Check Runs.
MIT License
43 stars 2 forks source link

Add Status Checks! #15

Closed Clivern closed 5 years ago

Clivern commented 5 years ago
https://help.github.com/articles/about-status-checks/#checks
Clivern commented 5 years ago

https://github.com/Clivern/Hamster/runs/24445872

$ curl -X POST -H "Authorization: token 5688665c91" -H "Content-Type: application/json" -H "Accept: application/vnd.github.antiope-preview+json" -d '{"name": "mighty_readme","head_sha": "2026a48419d4bfae3199a8c68cff02ed5ff091cd","status": "in_progress","external_id": "42","details_url": "http://clivern.com/42","started_at": "2018-10-17T01:14:52Z","output": {"title": "Mighty Readme report","summary": "","text": ""}}' "https://api.github.com/repos/clivern/hamster/check-runs"
{
  "id": 24445872,
  "node_id": "MDg6Q2hlY2tSdW4yNDQ0NTg3Mg==",
  "head_sha": "2026a48419d4bfae3199a8c68cff02ed5ff091cd",
  "external_id": "42",
  "url": "https://api.github.com/repos/Clivern/Hamster/check-runs/24445872",
  "html_url": "https://github.com/Clivern/Hamster/runs/24445872",
  "details_url": "http://clivern.com/42",
  "status": "in_progress",
  "conclusion": null,
  "started_at": "2018-10-17T01:14:52Z",
  "completed_at": null,
  "output": {
    "title": "Mighty Readme report",
    "summary": "",
    "text": "",
    "annotations_count": 0,
    "annotations_url": "https://api.github.com/repos/Clivern/Hamster/check-runs/24445872/annotations"
  },
  "name": "mighty_readme",
  "check_suite": {
    "id": 20110807
  },
  "app": {
    "id": 18984,
    "node_id": "MDM6QXBwMTg5ODQ=",
    "owner": {
      "login": "Clivern",
      "id": 1634427,
      "node_id": "MDQ6VXNlcjE2MzQ0Mjc=",
      "avatar_url": "https://avatars3.githubusercontent.com/u/1634427?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/Clivern",
      "html_url": "https://github.com/Clivern",
      "followers_url": "https://api.github.com/users/Clivern/followers",
      "following_url": "https://api.github.com/users/Clivern/following{/other_user}",
      "gists_url": "https://api.github.com/users/Clivern/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/Clivern/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/Clivern/subscriptions",
      "organizations_url": "https://api.github.com/users/Clivern/orgs",
      "repos_url": "https://api.github.com/users/Clivern/repos",
      "events_url": "https://api.github.com/users/Clivern/events{/privacy}",
      "received_events_url": "https://api.github.com/users/Clivern/received_events",
      "type": "User",
      "site_admin": false
    },
    "name": "HamsterCI",
    "description": "",
    "external_url": "https://ed33b84e.ngrok.io",
    "html_url": "https://github.com/apps/hamsterci",
    "created_at": "2018-10-13T17:28:57Z",
    "updated_at": "2018-10-17T18:26:31Z"
  },
  "pull_requests": [

  ]
}

$ curl -X PATCH -H "Authorization: token 5688665c91" -H "Content-Type: application/json" -H "Accept: application/vnd.github.antiope-preview+json" -d '{"name": "mighty_readme","head_sha": "2026a48419d4bfae3199a8c68cff02ed5ff091cd","status": "completed","conclusion":"success","started_at": "2018-10-17T10:39:10Z","completed_at": "2018-10-17T10:49:10Z","output": {"title": "Mighty Readme report","summary": "There are 0 failures, 2 warnings, and 1 notices.","text": "You may have some misspelled words on lines 2 and 4. You also may want to add a section in your README about how to install your app.","annotations": [{"path": "README.md","annotation_level": "warning","title": "Spell Checker","message": "Check your spelling for banaas.","raw_details": "Do you mean bananas or banana?","start_line": 2,"end_line": 2},{"path": "README.md","annotation_level": "warning","title": "Spell Checker","message": "Check your spelling for aples","raw_details": "Do you mean apples or Naples","start_line": 4,"end_line": 4}]},"actions": [{"label": "Fix","identifier": "fix_errors","description": "Allow us to fix these errors for you"}]}' "https://api.github.com/repos/clivern/hamster/check-runs/24445872"

{
  "id": 24445872,
  "node_id": "MDg6Q2hlY2tSdW4yNDQ0NTg3Mg==",
  "head_sha": "2026a48419d4bfae3199a8c68cff02ed5ff091cd",
  "external_id": "42",
  "url": "https://api.github.com/repos/Clivern/Hamster/check-runs/24445872",
  "html_url": "https://github.com/Clivern/Hamster/runs/24445872",
  "details_url": "http://clivern.com/42",
  "status": "completed",
  "conclusion": "success",
  "started_at": "2018-10-17T10:39:10Z",
  "completed_at": "2018-10-17T10:49:10Z",
  "output": {
    "title": "Mighty Readme report",
    "summary": "There are 0 failures, 2 warnings, and 1 notices.",
    "text": "You may have some misspelled words on lines 2 and 4. You also may want to add a section in your README about how to install your app.",
    "annotations_count": 2,
    "annotations_url": "https://api.github.com/repos/Clivern/Hamster/check-runs/24445872/annotations"
  },
  "name": "mighty_readme",
  "check_suite": {
    "id": 20110807
  },
  "app": {
    "id": 18984,
    "node_id": "MDM6QXBwMTg5ODQ=",
    "owner": {
      "login": "Clivern",
      "id": 1634427,
      "node_id": "MDQ6VXNlcjE2MzQ0Mjc=",
      "avatar_url": "https://avatars3.githubusercontent.com/u/1634427?v=4",
      "gravatar_id": "",
      "url": "https://api.github.com/users/Clivern",
      "html_url": "https://github.com/Clivern",
      "followers_url": "https://api.github.com/users/Clivern/followers",
      "following_url": "https://api.github.com/users/Clivern/following{/other_user}",
      "gists_url": "https://api.github.com/users/Clivern/gists{/gist_id}",
      "starred_url": "https://api.github.com/users/Clivern/starred{/owner}{/repo}",
      "subscriptions_url": "https://api.github.com/users/Clivern/subscriptions",
      "organizations_url": "https://api.github.com/users/Clivern/orgs",
      "repos_url": "https://api.github.com/users/Clivern/repos",
      "events_url": "https://api.github.com/users/Clivern/events{/privacy}",
      "received_events_url": "https://api.github.com/users/Clivern/received_events",
      "type": "User",
      "site_admin": false
    },
    "name": "HamsterCI",
    "description": "",
    "external_url": "https://ed33b84e.ngrok.io",
    "html_url": "https://github.com/apps/hamsterci",
    "created_at": "2018-10-13T17:28:57Z",
    "updated_at": "2018-10-17T18:26:31Z"
  },
  "pull_requests": [

  ]
}