From 1f81416366ac0a7735e5d48f00f68a38de226958 Mon Sep 17 00:00:00 2001 From: hemengyang Date: Fri, 7 Apr 2023 23:09:48 +0800 Subject: [PATCH] =?UTF-8?q?change:=20=E8=B0=83=E6=95=B4=E4=BC=A0=E5=85=A5?= =?UTF-8?q?=20app=5Fid=20=E5=92=8C=20PRIVATE=5FKEY=20=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 ++----- bot.py | 7 ++++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 99b80b84..a5460b39 100644 --- a/README.md +++ b/README.md @@ -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 }} ``` ## 测试 diff --git a/bot.py b/bot.py index 83fcffa1..004eee69 100644 --- a/bot.py +++ b/bot.py @@ -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)