check the assume yes publish flag command before the presence of bind mounts

Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
This commit is contained in:
Guillaume Lours 2025-08-13 10:07:36 +02:00 committed by Nicolas De loof
parent 60681a824c
commit c420bc44c4

View File

@ -236,6 +236,9 @@ func (s *composeService) preChecks(project *types.Project, options api.PublishOp
if ok, err := s.checkOnlyBuildSection(project); !ok || err != nil {
return false, err
}
if options.AssumeYes {
return true, nil
}
bindMounts := s.checkForBindMount(project)
if len(bindMounts) > 0 {
fmt.Println("you are about to publish bind mounts declaration within your OCI artifact.\n" +
@ -251,9 +254,6 @@ func (s *composeService) preChecks(project *types.Project, options api.PublishOp
return false, err
}
}
if options.AssumeYes {
return true, nil
}
detectedSecrets, err := s.checkForSensitiveData(project)
if err != nil {
return false, err