-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
XS✔ ◾ v1.4.2: Bug fix for GitHub API restrictions (#221)
The GitHub API will fail to add a comment to a file in a PR if the file diff is larger than a specific threshold. In these cases, PR Metrics will throw an error, preventing further execution. The error is now caught and handled in the cases where it is expected, but still thrown for other errors. There has also been some refactoring to extract out shared logic. Tests have been updated. In addition, the version of PR Metrics has been updated to v1.4.2 to allow this change to be released to the marketplaces.
- Loading branch information
1 parent
161e80b
commit f285339
Showing
16 changed files
with
1,192 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,7 @@ The default input values are expected to be appropriate for most builds. | |
Therefore, the following YAML definition is recommended: | ||
|
||
```YAML | ||
uses: microsoft/[email protected].1 | ||
uses: microsoft/[email protected].2 | ||
name: PR Metrics | ||
env: | ||
PR_METRICS_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -108,7 +108,7 @@ continue-on-error: true | |
If you wish to modify the inputs, YAML akin the to the following can be used: | ||
```YAML | ||
uses: microsoft/[email protected].1 | ||
uses: microsoft/[email protected].2 | ||
name: PR Metrics | ||
env: | ||
PR_METRICS_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
/** | ||
* A class representing a HTTP error. | ||
*/ | ||
export default class HttpError extends Error { | ||
/** | ||
* Initializes a new instance of the `HttpError` class. | ||
* @param status The HTTP status code. | ||
* @param message The error message. | ||
*/ | ||
public constructor (status: number, message: string) { | ||
super() | ||
|
||
this.status = status | ||
this.message = message | ||
} | ||
|
||
/** | ||
* Gets the name of the object type. | ||
*/ | ||
public name: string = 'HttpError' | ||
|
||
/** | ||
* Gets the HTTP status code. | ||
*/ | ||
public status: number | ||
|
||
/** | ||
* Gets the error message. | ||
*/ | ||
public message: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters