-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass GithubToken as option when building probot serverless app #36
Comments
Could you elaborate in which case you would want a serverless lambda function to run with a static token? Is this for async event handling? The problem is that tokens can expire. Would it make more sense to use a Redis cache for the tokens that can be access across all your functions? |
As far as I understand the token generated is not static right? On each webhook triggered, We were getting authentication issues when running the app without this
Let's do something, if you agree on that. Once we migrate to latest version of Sounds good to you @gr2m ? |
Sounds good, yes! The way tokens are generated changed with the adoption of |
This will be possible via #59 const { createLambdaFunction, createProbot } = require("@probot/adapter-aws-lambda-serverless");
const appFn = require("./");
module.exports.webhooks = createLambdaFunction(appFn, {
probot: createProbot({
defaults: {
githubToken: process.env.GITHUB_TOKEN
}
})
}); |
🎉 This issue has been resolved in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
https://github.com/probot/serverless-lambda/blob/a4688897217d206f0397d81dc4b457123fc302b9/index.js#L8-L13
Problem:
Right now is not possible to create a serverless probot app with a
githubToken
as option so we obtain an authenticated Github App installation.Context:
Trying to create a serverless probot authenticated with Github App Installation but not possible on creation with the constructor parameters offered right now.
A workaround is a wrapper
appFn
used as callback for the.on()
where we do the authentication:Solution proposal:
To support
process.env.GITHUB_TOKEN
environment variable and callcreateProbot(
Options)
withgithubToken
in theOptions
The text was updated successfully, but these errors were encountered: