Last active
May 11, 2018 19:37
-
-
Save swinton/8677b6f99cc2b06c4b50f141b551d300 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSTALLATION_TOKEN= # Your installation access token |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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