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)