This repository was archived by the owner on Jul 13, 2023. It is now read-only.
Commit cbc1f7b 1 parent cec8c65 commit cbc1f7b Copy full SHA for cbc1f7b
File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Determines whether the task is running against a supported pull request provider.
3
+ * @returns `true` if the task is running against a supported pull request provider, or the name of the pull request provider otherwise.
4
+ */
5
+ export function isSupportedProvider ( ) : boolean {
6
+ console . debug ( "* PRComment.isSupportedProvider" ) ;
7
+
8
+ // If the action is running on Azure DevOps, check the provider.
9
+ const variable : string | undefined = process . env [ "BUILD_REPOSITORY_PROVIDER" ] ;
10
+
11
+ if ( variable === "TfsGit" ) {
12
+ return true ;
13
+ }
14
+ return false ;
15
+ }
Original file line number Diff line number Diff line change @@ -3,11 +3,17 @@ import { client } from "../../azdoRepoClient";
3
3
import { findVercelPRComment } from "./findVercelPRComment" ;
4
4
import { getNewCommentStatus } from "./getNewCommentStatus" ;
5
5
import { getPRCommentData , PullRequestCommentsData } from "./getPRCommentData" ;
6
+ import { isSupportedProvider } from "./isPRCommentSupported" ;
6
7
7
8
export const publishPRComment = async (
8
9
event ?: Deployment ,
9
10
error ?: DeploymentError
10
11
) => {
12
+ if ( ! isSupportedProvider ( ) ) {
13
+ console . log ( "* PRComment.publishPRComment: not supported provider" ) ;
14
+ return ;
15
+ }
16
+
11
17
const azdoClient = new client ( ) ;
12
18
const comments = await azdoClient . getComments ( ) ;
13
19
You can’t perform that action at this time.
0 commit comments