File tree Expand file tree Collapse file tree
apps/sim/connectors/gitlab Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1067,18 +1067,21 @@ export const gitlabConnector: ConnectorConfig = {
10671067
10681068 const userRef = typeof sourceConfig . ref === 'string' ? sourceConfig . ref . trim ( ) : ''
10691069 if ( userRef && activePhases ( choice ) . includes ( 'repo' ) ) {
1070- const branchResponse = await fetchWithRetry (
1071- `${ apiBase } /projects/${ encodedProject } /repository/branches /${ encodeURIComponent ( userRef ) } ` ,
1070+ const refResponse = await fetchWithRetry (
1071+ `${ apiBase } /projects/${ encodedProject } /repository/commits /${ encodeURIComponent ( userRef ) } ` ,
10721072 { method : 'GET' , headers : authHeaders ( accessToken ) } ,
10731073 VALIDATE_RETRY_OPTIONS
10741074 )
1075- if ( branchResponse . status === 404 ) {
1076- return { valid : false , error : `Branch "${ userRef } " not found in project "${ project } "` }
1075+ if ( refResponse . status === 404 ) {
1076+ return {
1077+ valid : false ,
1078+ error : `Branch, tag, or commit "${ userRef } " not found in project "${ project } "` ,
1079+ }
10771080 }
1078- if ( ! branchResponse . ok ) {
1081+ if ( ! refResponse . ok ) {
10791082 return {
10801083 valid : false ,
1081- error : `Cannot verify branch "${ userRef } ": ${ branchResponse . status } ` ,
1084+ error : `Cannot verify ref "${ userRef } ": ${ refResponse . status } ` ,
10821085 }
10831086 }
10841087 }
You can’t perform that action at this time.
0 commit comments