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
Upgrading from 11.4.1 to 12.2.5 #1711
Comments
Thanks for opening this issue. A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines and explore other ways you can get involved. |
try const owner = context.payload.repository?.owner.login; The |
I tried that, unfortunately same error. src/comments.ts(81,33): error TS2339: Property 'repository' does not exist on type 'BranchProtectionRuleCreatedEvent | BranchProtectionRuleDeletedEvent | BranchProtectionRuleEditedEvent | ... 381 more ... | WorkflowDispatchEvent'.
Property 'repository' does not exist on type 'never'. |
This should work for you if ('repository' in context.payload) {
// do stuff here
} |
That works, however, there would be a lot of |
Yes, it has. We have upgraded to use Instead of handling all the events in one handler, simply use one per event app.on("pull_request", (context) => {
// Do stuff here
app.log.info(`Repo: ${context.repository}`);
}); |
@mimartin12 you can use const params = context.pullRequest()
// Returns: {owner: 'username', repo: 'reponame', pull_number: 123} https://probot.github.io/api/latest/classes/context.Context.html#pullRequest
|
The solution is to write a typeguard. |
Hey, I am having issues going from 11.4.1 to 12.2.5. When I upgrade, and I run
npm install && npm run build
I get the following.Code:
Am I missing something that needs to be changed during an upgrade?
The text was updated successfully, but these errors were encountered: