Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Merge Refactor/move to delegated compute into Development #929

Merged
merged 10 commits into from
Jun 7, 2024
Merged
8 changes: 8 additions & 0 deletions .github/ubiquibot-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
payments:
basePriceMultiplier: 1.5
features:
newContributorGreeting:
enabled: true
header: "Thank you for contributing to UbiquiBot! Please be sure to set your wallet address before completing your first task so that the automatic payout upon task completion will work for you."
displayHelpMenu: true
footer: "###### Also please star this repository and [@ubiquity/devpool-directory](https://github.com/ubiquity/devpool-directory/) to show your support. It helps a lot!"
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,5 @@
"ext": "ts",
"exec": "bun start"
},
"packageManager": "bun@1.0.23"
}
"packageManager": "bun@1.1.0"
}
22 changes: 13 additions & 9 deletions src/helpers/issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,19 @@ export async function isUserAdminOrBillingManager(

async function checkIfIsBillingManager() {
if (!payload.organization) throw context.logger.fatal(`No organization found in payload!`);
const { data: membership } = await context.octokit.rest.orgs.getMembershipForUser({
org: payload.organization.login,
username: payload.repository.owner.login,
});

console.trace(membership);
if (membership.role === "billing_manager") {
return true;
} else {
try {
const { data: membership } = await context.octokit.rest.orgs.getMembershipForUser({
org: payload.organization.login,
username: payload.repository.owner.login,
});

console.trace(membership);
return membership.role === "billing_manager";
} catch (e) {
context.logger.error(
`Could not get the Billing Manager status for ${payload.repository.owner.login} within ${payload.organization.login}`,
e
);
return false;
}
}
Expand Down
Loading