Skip to content

Commit

Permalink
feat: update to Probot v10 (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m authored Aug 9, 2020
1 parent bdcde20 commit 153feae
Show file tree
Hide file tree
Showing 15 changed files with 1,397 additions and 1,192 deletions.
3 changes: 3 additions & 0 deletions lib/common/reset-repositories.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ function toEvent({ context, plan, owner, repo, pullRequest }) {
event: "pull_request",
plan,
github: context.github,
async config() {
// TODO make loading configuration work
},
log: context.log,
repo(options) {
return Object.assign(
Expand Down
2 changes: 1 addition & 1 deletion lib/get-plan.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function getPlan(robot, owner) {
data: {
marketplace_purchase: { plan },
},
} = await authenticatedAsApp.apps.checkAccountIsAssociatedWithAny({
} = await authenticatedAsApp.apps.getSubscriptionPlanForAccount({
account_id: owner.id,
});

Expand Down
2 changes: 1 addition & 1 deletion lib/handle-pull-request-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function handlePullRequestChange(app, context) {
timeStart,
});

// if status did not change then don’t call .createStatus. Quotas for mutations
// if status did not change then don’t call .createCommitStatus. Quotas for mutations
// are much more restrictive so we want to avoid them if possible
if (!hasChange) {
return log.noUpdate();
Expand Down
2 changes: 1 addition & 1 deletion lib/legacy/handle-pull-request-change.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function handlePullRequestChange(context) {
: `https://github.com/settings/installations/${installation.id}/permissions/update`;

try {
await context.github.repos.createStatus(
await context.github.repos.createCommitStatus(
context.repo({
sha: pr.head.sha,
state: newStatus,
Expand Down
2 changes: 1 addition & 1 deletion lib/legacy/overwrite-commit-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function overwriteCommitStatus(context) {
return;
}

await context.github.repos.createStatus(
await context.github.repos.createCommitStatus(
context.repo({
sha,
state: "success",
Expand Down
4 changes: 1 addition & 3 deletions lib/pro/get-config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
module.exports = getConfig;

const probotConfig = require("probot-config");

const defaultConfig = require("./default-config");

// load config from the repository’s .github/wip.yml file and normalize it
async function getConfig(context) {
let config = await probotConfig(context, "wip.yml");
let config = await context.config("wip.yml");

if (!config) {
return {
Expand Down
Loading

0 comments on commit 153feae

Please sign in to comment.