-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bypass accept_ms_testers_without_closed_task (#49)
- Loading branch information
1 parent
e1be7a8
commit 2fa672c
Showing
2 changed files
with
8 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
const yaml = require("js-yaml"); | ||
const { octokit } = require("./actions/octokit"); | ||
const getOctokit = require("./actions/octokit"); | ||
|
||
const octokit = getOctokit(); | ||
|
||
exports.getMobsuccessYMLFromRepo = async function getMobsuccessYMLFromRepo({ | ||
owner, | ||
repo, | ||
branch, | ||
}) { | ||
try { | ||
const { data } = await octokit.rest.repos.getContent({ | ||
const { data } = await octokit.repos.getContent({ | ||
owner, | ||
repo, | ||
path: ".mobsuccess.yml", | ||
ref: branch || "master", | ||
}); | ||
const content = Buffer.from(data.content, "base64").toString("utf8"); | ||
return yaml.load(content); | ||
} catch (e) { | ||
console.log("Error getting .mobsuccess.yml from repo", e); | ||
return {}; | ||
} | ||
}; |