@@ -67,46 +67,32 @@ async function validateSubscription() {
6767 const repoPrivate = github . context ?. payload ?. repository ?. private ;
6868 const visibilityUnknown = repoPrivate === undefined ;
6969
70- core . info ( `Starting subscription validation - Repository private: ${ repoPrivate } , Visibility unknown: ${ visibilityUnknown } ` ) ;
71-
7270 if ( repoPrivate === false ) {
7371 core . info ( 'Repository is public, skipping subscription validation.' ) ;
7472 return ;
7573 }
7674
77- if ( repoPrivate === true ) {
78- core . info ( 'Repository is private, proceeding with subscription validation.' ) ;
79- } else if ( visibilityUnknown ) {
80- core . info ( 'Repository visibility is unknown, proceeding with subscription validation.' ) ;
81- }
82-
8375 const serverUrl = process . env . GITHUB_SERVER_URL || 'https://github.com' ;
8476 const params : Record < string , string > = { } ;
8577 if ( process . env . GITHUB_ACTION_REPOSITORY ) params . action = process . env . GITHUB_ACTION_REPOSITORY ;
8678 if ( serverUrl !== 'https://github.com' ) params . ghes_server = serverUrl ;
8779 if ( visibilityUnknown ) params . repo_visibility = 'unknown' ;
8880
89- core . debug ( `Validation params: ${ JSON . stringify ( params ) } ` ) ;
90-
9181 try {
92- core . info ( 'Checking subscription status...' ) ;
9382 await axios . get (
9483 `https://agent.api.stepsecurity.io/v1/github/${ process . env . GITHUB_REPOSITORY } /actions/subscription` ,
9584 { params, timeout : 3000 }
9685 ) ;
97- core . info ( 'Subscription validation successful.' ) ;
9886 } catch ( error ) {
9987 if ( isAxiosError ( error ) && error . response ?. status === 403 ) {
100- core . error ( 'Subscription validation failed: 403 Forbidden' ) ;
101- console . error (
88+ core . error (
10289 'This StepSecurity maintained action is free for public repositories.\n' +
10390 'This repository is private and does not currently have a StepSecurity Enterprise subscription enabled, so the action was not executed.\n\n' +
10491 'Learn more:\n' +
10592 'https://docs.stepsecurity.io/actions/stepsecurity-maintained-actions'
10693 ) ;
10794 process . exit ( 1 ) ;
10895 }
109- core . warning ( `Subscription validation error: ${ error instanceof Error ? error . message : 'Unknown error' } ` ) ;
11096 core . info ( 'Timeout or API not reachable. Continuing to next step.' ) ;
11197 }
11298}
0 commit comments