Skip to content

Commit

Permalink
change: 调整传入 app_id 和 PRIVATE_KEY 的方法
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 committed Apr 7, 2023
1 parent 1380ed9 commit 1f81416
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,8 @@ jobs:
env:
PLUGIN_TEST_RESULT: ${{ needs.plugin_test.outputs.result }}
PLUGIN_TEST_OUTPUT: ${{ needs.plugin_test.outputs.output }}
GITHUB_APPS: >
[{
"app_id": "${{ secrets.APP_ID }}",
"private_key": "${{ secrets.APP_KEY }}"
}]
APP_ID: ${{ secrets.APP_ID }}
PRIVATE_KEY: ${{ secrets.APP_KEY }}
```
## 测试
Expand Down
7 changes: 6 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ def payload_to_event(


with ensure_cwd(Path(__file__).parent):
nonebot.init(driver="~none")
app_id = os.environ.get("APP_ID")
private_key = os.environ.get("PRIVATE_KEY")

nonebot.init(
driver="~none", github_apps=[{"app_id": app_id, "private_key": private_key}]
)

driver = nonebot.get_driver()
driver.register_adapter(Adapter)
Expand Down

0 comments on commit 1f81416

Please sign in to comment.