Create/Update check run
diff --git a/.gitignore b/.gitignore
index 18e337d..b1f7d2d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -96,4 +96,4 @@
 
 # Ignore built ts files
 __tests__/runner/*
-lib/**/*
\ No newline at end of file
+lib
diff --git a/README.md b/README.md
index 50aeb47..d3b92a1 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,21 @@
 # GitHub Actions: `checks-action` ![build-test](https://github.com/LouisBrunner/checks-action/workflows/build-test/badge.svg)
 
-TODO: description
+TODO: description & usage
 
-# Usage
+## Inputs
 
-TODO: usage
+### `who-to-greet`
+
+**Required** The name of the person to greet. Default `"World"`.
+
+## Outputs
+
+### `time`
+
+The time we greeted you.
+
+## Example usage
+
+uses: actions/hello-world-javascript-action@v1
+with:
+  who-to-greet: 'Mona the Octocat'
diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts
index dc55b7b..32cf034 100644
--- a/__tests__/main.test.ts
+++ b/__tests__/main.test.ts
@@ -5,7 +5,7 @@
 // shows how the runner will run a javascript action with env / stdout protocol
 test('test runs', () => {
   process.env['TOKEN'] = 'ABC'
-  const ip = path.join(__dirname, '..', 'dist', 'index.js')
+  const ip = path.join(__dirname, '..', 'lib', 'main.js')
   const options: cp.ExecSyncOptions = {
     env: process.env,
   }
diff --git a/dist/index.js b/dist/index.js
index b93d54d..24aa44e 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -1 +1 @@
-module.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(429)}return startup()}({87:function(e){e.exports=require("os")},429:function(e,t,r){e.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(429)}return startup()}({87:function(e){e.exports=r(87)},429:function(e,t,r){e.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(429)}return startup()}({87:function(e){e.exports=r(87)},429:function(e,t,r){e.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(429)}return startup()}({87:function(e){e.exports=r(87)},429:function(e,t,r){e.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(198)}return startup()}({87:function(e){e.exports=r(87)},198:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const u=i(r(470));const s=r(521);function run(){return n(this,void 0,void 0,function*(){try{const e=u.getInput("milliseconds");u.debug(`Waiting ${e} milliseconds ...`);u.debug((new Date).toTimeString());yield s.wait(parseInt(e,10));u.debug((new Date).toTimeString());u.setOutput("time",(new Date).toTimeString())}catch(e){u.setFailed(e.message)}})}run()},431:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(87);function issueCommand(e,t,r){const i=new Command(e,t,r);process.stdout.write(i.toString()+n.EOL)}t.issueCommand=issueCommand;function issue(e,t){issueCommand(e,{},t)}t.issue=issue;const i="##[";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=i+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";for(const t in this.properties){if(this.properties.hasOwnProperty(t)){const r=this.properties[t];if(r){e+=`${t}=${escape(`${r||""}`)};`}}}}e+="]";const t=`${this.message||""}`;e+=escapeData(t);return e}}function escapeData(e){return e.replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escape(e){return e.replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/]/g,"%5D").replace(/;/g,"%3B")}},470:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(431);const i=r(622);var u;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(u=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){process.env[e]=t;n.issueCommand("set-env",{name:e},t)}t.exportVariable=exportVariable;function exportSecret(e,t){exportVariable(e,t);n.issueCommand("set-secret",{},t)}t.exportSecret=exportSecret;function addPath(e){n.issueCommand("add-path",{},e);process.env["PATH"]=`${e}${i.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const r=process.env[`INPUT_${e.replace(" ","_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}return r.trim()}t.getInput=getInput;function setOutput(e,t){n.issueCommand("set-output",{name:e},t)}t.setOutput=setOutput;function setFailed(e){process.exitCode=u.Failure;error(e)}t.setFailed=setFailed;function debug(e){n.issueCommand("debug",{},e)}t.debug=debug;function error(e){n.issue("error",e)}t.error=error;function warning(e){n.issue("warning",e)}t.warning=warning},521:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});function wait(e){return r(this,void 0,void 0,function*(){return new Promise(t=>{if(isNaN(e)){throw new Error("milliseconds not a number")}setTimeout(()=>t("done!"),e)})})}t.wait=wait},622:function(e){e.exports=r(622)}})},622:function(e){e.exports=r(622)}})},622:function(e){e.exports=r(622)}})},622:function(e){e.exports=r(622)}})},622:function(e){e.exports=require("path")}});
\ No newline at end of file
+module.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(429)}return startup()}({87:function(e){e.exports=require("os")},429:function(e,t,r){e.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(429)}return startup()}({87:function(e){e.exports=r(87)},429:function(e,t,r){e.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(429)}return startup()}({87:function(e){e.exports=r(87)},429:function(e,t,r){e.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(429)}return startup()}({87:function(e){e.exports=r(87)},429:function(e,t,r){e.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(429)}return startup()}({87:function(e){e.exports=r(87)},429:function(e,t,r){e.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(429)}return startup()}({87:function(e){e.exports=r(87)},429:function(e,t,r){e.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(429)}return startup()}({87:function(e){e.exports=r(87)},429:function(e,t,r){e.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(198)}return startup()}({87:function(e){e.exports=r(87)},198:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const u=i(r(470));const o=r(521);function run(){return n(this,void 0,void 0,function*(){try{const e=u.getInput("milliseconds");u.debug(`Waiting ${e} milliseconds ...`);u.debug((new Date).toTimeString());yield o.wait(parseInt(e,10));u.debug((new Date).toTimeString());u.setOutput("time",(new Date).toTimeString())}catch(e){u.setFailed(e.message)}})}run()},431:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(87);function issueCommand(e,t,r){const i=new Command(e,t,r);process.stdout.write(i.toString()+n.EOL)}t.issueCommand=issueCommand;function issue(e,t){issueCommand(e,{},t)}t.issue=issue;const i="##[";class Command{constructor(e,t,r){if(!e){e="missing.command"}this.command=e;this.properties=t;this.message=r}toString(){let e=i+this.command;if(this.properties&&Object.keys(this.properties).length>0){e+=" ";for(const t in this.properties){if(this.properties.hasOwnProperty(t)){const r=this.properties[t];if(r){e+=`${t}=${escape(`${r||""}`)};`}}}}e+="]";const t=`${this.message||""}`;e+=escapeData(t);return e}}function escapeData(e){return e.replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escape(e){return e.replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/]/g,"%5D").replace(/;/g,"%3B")}},470:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(431);const i=r(622);var u;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(u=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){process.env[e]=t;n.issueCommand("set-env",{name:e},t)}t.exportVariable=exportVariable;function exportSecret(e,t){exportVariable(e,t);n.issueCommand("set-secret",{},t)}t.exportSecret=exportSecret;function addPath(e){n.issueCommand("add-path",{},e);process.env["PATH"]=`${e}${i.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const r=process.env[`INPUT_${e.replace(" ","_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}return r.trim()}t.getInput=getInput;function setOutput(e,t){n.issueCommand("set-output",{name:e},t)}t.setOutput=setOutput;function setFailed(e){process.exitCode=u.Failure;error(e)}t.setFailed=setFailed;function debug(e){n.issueCommand("debug",{},e)}t.debug=debug;function error(e){n.issue("error",e)}t.error=error;function warning(e){n.issue("warning",e)}t.warning=warning},521:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:true});function wait(e){return r(this,void 0,void 0,function*(){return new Promise(t=>{if(isNaN(e)){throw new Error("milliseconds not a number")}setTimeout(()=>t("done!"),e)})})}t.wait=wait},622:function(e){e.exports=r(622)}})},622:function(e){e.exports=r(622)}})},622:function(e){e.exports=r(622)}})},622:function(e){e.exports=r(622)}})},622:function(e){e.exports=r(622)}})},622:function(e){e.exports=r(622)}})},622:function(e){e.exports=r(622)}})},622:function(e){e.exports=require("path")}});
\ No newline at end of file
diff --git a/src/main.ts b/src/main.ts
index 681610b..0208cac 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -9,14 +9,33 @@
     core.debug(`Setting up OctoKit`)
     const octokit = new github.GitHub(token)
 
-    const checkRuns = octokit.checks.listForRef({
+    const ownership = {
       owner: github.context.repo.owner,
       repo: github.context.repo.repo,
+    }
+
+    const info = { // TODO: from argument
+    }
+
+    const { data } = await octokit.checks.listForRef({
+      ...ownership,
       ref: github.context.sha,
     })
-    core.info(JSON.stringify(checkRuns))
 
-    // TODO: finish
+    if (data.check_runs.length > 0) {
+      octokit.checks.update({
+        ...ownership,
+        check_run_id: data.check_runs[0].id,
+        ...info,
+      })
+    } else {
+      octokit.checks.create({
+        ...ownership,
+        head_sha: github.context.sha,
+        name: 'Check Run Test', // TODO: from argument
+        ...info,
+      })
+    }
   } catch (error) {
     core.setFailed(error.message)
   }