Skip to content

Instantly share code, notes, and snippets.

@swinton
Last active May 11, 2018 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swinton/8677b6f99cc2b06c4b50f141b551d300 to your computer and use it in GitHub Desktop.
Save swinton/8677b6f99cc2b06c4b50f141b551d300 to your computer and use it in GitHub Desktop.
INSTALLATION_TOKEN= # Your installation access token
require('dotenv').config()
const octokit = require('@octokit/rest')()
const logResponse = resp => console.log('%j', resp)
octokit.authenticate({
type: 'integration',
token: process.env.INSTALLATION_TOKEN
})
octokit.checks.create({
owner: 'swinton',
repo: 'example',
name: 'feedback',
head_branch: 'helloworld',
head_sha: '2e3d00a6f14a667d50ad9ccd6f3dcfded52121e2',
status: 'in_progress',
started_at: (new Date()).toISOString(), // The time that the check run began in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`
completed_at: (new Date()).toISOString(),
conclusion: 'status',
headers: {
'Accept': 'application/vnd.github.antiope-preview+json,application/vnd.github.machine-man-preview+json'
}
}).then(logResponse, logResponse)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment