Last active
June 16, 2019 13:29
-
-
Save pmarques/9ba18817a074c93194ce362b159349d5 to your computer and use it in GitHub Desktop.
Fetch file from private github repo
This file contains 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
const Octokit = require('@octokit/rest') | |
const octokit = new Octokit({ | |
auth: "<my github access token", | |
userAgent: "pmarques 1.0" // tried with and without | |
}) | |
octokit.repos.getContents({ | |
"owner": "ansible", | |
"repo": "ansible", | |
"path": "README.rst", | |
"ref": "devel" | |
}) | |
.then( (data) => { | |
console.log("data") | |
}) | |
.catch( (err) => { | |
console.log(err) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment