generated from ubiquity/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from ubiquibot/development
Merge develop into main
- Loading branch information
Showing
32 changed files
with
1,179 additions
and
92 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
GITHUB_TOKEN="<token>" | ||
OPENAI_API_KEY="<api_key>" | ||
# treasury fee applied to the final permits, ex: 100 = 100%, 0.1 = 0.1% | ||
PERMIT_FEE_RATE="" | ||
# github account associated with EVM treasury address allowed to claim permit fees, ex: "ubiquibot-treasury" | ||
PERMIT_TREASURY_GITHUB_USERNAME="" | ||
# comma separated list of token addresses which should not incur any fees, ex: "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d, 0x4ECaBa5870353805a9F068101A40E0f32ed605C6" | ||
PERMIT_ERC20_TOKENS_NO_FEE_WHITELIST="" |
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
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 |
---|---|---|
|
@@ -17,3 +17,4 @@ jobs: | |
- uses: googleapis/release-please-action@v4 | ||
with: | ||
release-type: simple | ||
target-branch: main |
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "Conversation rewards", | ||
"description": "Generate rewards for on topic conversation for closing issues as complete.", | ||
"ubiquity:listeners": [ "issues.closed" ] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Static, Type } from "@sinclair/typebox"; | ||
|
||
export const dataCollectionConfigurationType = Type.Object({ | ||
/** | ||
* The maximum amount of retries on failure. | ||
*/ | ||
maxAttempts: Type.Number({ default: 10, minimum: 1 }), | ||
/** | ||
* The delay between each retry, in milliseconds. | ||
*/ | ||
delayMs: Type.Number({ default: 10000, minimum: 100 }), | ||
}); | ||
|
||
export type DataCollectionConfiguration = Static<typeof dataCollectionConfigurationType>; |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import * as github from "@actions/github"; | ||
import { GithubCommentModule } from "../parser/github-comment-module"; | ||
|
||
export function getGithubWorkflowRunUrl() { | ||
return `${github.context.payload.repository?.html_url}/actions/runs/${github.context.runId}`; | ||
} | ||
|
||
const githubCommentModule = new GithubCommentModule(); | ||
|
||
export default githubCommentModule; |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { Logs } from "@ubiquity-dao/ubiquibot-logger"; | ||
|
||
const logger = new Logs("debug"); | ||
|
||
export default logger; |
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,13 +1,22 @@ | ||
import * as core from "@actions/core"; | ||
import githubCommentModuleInstance, { getGithubWorkflowRunUrl } from "./helpers/github-comment-module-instance"; | ||
import logger from "./helpers/logger"; | ||
import { run } from "./run"; | ||
|
||
export default run() | ||
.then((result) => { | ||
core?.setOutput("result", result); | ||
return result; | ||
}) | ||
.catch((e) => { | ||
console.error("Failed to run comment evaluation:", e); | ||
core?.setFailed(e.toString()); | ||
.catch(async (e) => { | ||
const errorMessage = logger.error(`Failed to run comment evaluation. ${e}`, e); | ||
try { | ||
await githubCommentModuleInstance.postComment( | ||
`${errorMessage?.logMessage.diff}\n<!--\n${getGithubWorkflowRunUrl()}\n${JSON.stringify(errorMessage?.metadata, null, 2)}\n-->` | ||
); | ||
} catch (err) { | ||
logger.error(`Failed to update Github comment: ${err}`); | ||
} | ||
core?.setFailed(e); | ||
return e; | ||
}); |
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
Oops, something went wrong.