@@ -16,6 +16,11 @@ async function run(): Promise<void> {
1616 core . info ( 'Asymptote Security Scan starting...' ) ;
1717 core . debug ( `API URL: ${ config . apiUrl } ` ) ;
1818
19+ const client = new AsymptoteClient ( {
20+ apiKey : config . apiKey ,
21+ baseUrl : config . apiUrl ,
22+ } ) ;
23+
1924 // 2. Verify PR context
2025 if ( github . context . eventName !== 'pull_request' ) {
2126 core . setFailed (
@@ -34,6 +39,28 @@ async function run(): Promise<void> {
3439 }
3540 const octokit = github . getOctokit ( githubToken ) ;
3641
42+ try {
43+ const integration = await client . getRepositoryIntegrationMode (
44+ github . context . repo . owner ,
45+ github . context . repo . repo
46+ ) ;
47+ if ( integration . integration_mode === 'github_app' ) {
48+ core . info (
49+ 'Repository is configured for GitHub App PR reviews; exiting legacy action without posting comments or checks.'
50+ ) ;
51+ core . setOutput ( 'decision' , 'allow' ) ;
52+ core . setOutput ( 'total_violations' , 0 ) ;
53+ core . setOutput ( 'critical_count' , 0 ) ;
54+ core . setOutput ( 'high_count' , 0 ) ;
55+ core . setOutput ( 'medium_count' , 0 ) ;
56+ return ;
57+ }
58+ } catch ( error ) {
59+ core . warning (
60+ `Failed to look up repository integration mode; continuing with legacy action path. ${ error instanceof Error ? error . message : String ( error ) } `
61+ ) ;
62+ }
63+
3764 // 4. Get PR diff (incremental on synchronize, full otherwise)
3865 const action = github . context . payload . action ;
3966 const before = github . context . payload . before ;
@@ -140,10 +167,6 @@ async function run(): Promise<void> {
140167
141168 // 5. Call Asymptote API
142169 core . info ( 'Submitting diff for evaluation...' ) ;
143- const client = new AsymptoteClient ( {
144- apiKey : config . apiKey ,
145- baseUrl : config . apiUrl ,
146- } ) ;
147170
148171 let result ;
149172 try {
0 commit comments