-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add MoT to Private Specs Repository #3950
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
|
|
||
| 'use strict'; | ||
|
|
||
| const octokit = require('@octokit/rest')(); | ||
| let token = process.env.GITHUB_TOKEN; | ||
|
|
||
| if(token != undefined) { | ||
| octokit.authenticate({ | ||
| type: 'token', | ||
| token: token | ||
| }); | ||
| } | ||
|
|
||
| module.exports = { | ||
| postGithubComment: function(owner, repository, prNumber, commentBody) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we concerned that every time a commit is pushed, a new build will run and this will create a new comment? If so, maybe we can put an identifier in the comment and then either create a new comment or update the existing one if found. SwaggerToSdk is already doing this (it matches on the header text) but you should also be able to do it by inserting an HTML comment like |
||
| octokit.issues.createComment({ | ||
| "owner": owner, | ||
| "repo": repository, | ||
| "number": prNumber, | ||
| "body": commentBody | ||
| }).then(data => { | ||
| console.log("Comment has been posted"); | ||
| }). catch(err => { | ||
| console.log(err); | ||
| }); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the intent behind this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is related to the issue specified by Joel.