Skip to content

Commit

Permalink
Block publishing to MAR endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
adityapatwardhan committed Oct 29, 2024
1 parent 643cd7c commit 955389d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/code/PublishHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,17 @@ internal void PushResource(string Repository, string modulePrefix, bool SkipDepe
return;
}

if (repository.IsMARRepository())
{
_cmdletPassedIn.WriteError(new ErrorRecord(
new PSInvalidOperationException($"Repository '{repository.Name}' is a MAR repository and cannot be published to."),
"MARRepositoryPublishError",
ErrorCategory.PermissionDenied,
this));

return;
}

_networkCredential = Utils.SetNetworkCredential(repository, _networkCredential, _cmdletPassedIn);

// Check if dependencies already exist within the repo if:
Expand Down

0 comments on commit 955389d

Please sign in to comment.