diff --git a/src/GitReleaseManager.Core/Commands/AddAssetsCommand.cs b/src/GitReleaseManager.Core/Commands/AddAssetsCommand.cs index 3073bc33..8765f18e 100644 --- a/src/GitReleaseManager.Core/Commands/AddAssetsCommand.cs +++ b/src/GitReleaseManager.Core/Commands/AddAssetsCommand.cs @@ -17,6 +17,14 @@ public AddAssetsCommand(IVcsService vcsService, ILogger logger) public async Task ExecuteAsync(AddAssetSubOptions options) { + var vcsOptions = options as BaseVcsOptions; + + if (vcsOptions?.Provider == Model.VcsProvider.GitLab) + { + _logger.Error("The addasset command is currently not supported when targetting GitLab."); + return 1; + } + _logger.Information("Uploading assets"); await _vcsService.AddAssetsAsync(options.RepositoryOwner, options.RepositoryName, options.TagName, options.AssetPaths).ConfigureAwait(false); diff --git a/src/GitReleaseManager.Core/Commands/LabelCommand.cs b/src/GitReleaseManager.Core/Commands/LabelCommand.cs index da12d955..1a766b90 100644 --- a/src/GitReleaseManager.Core/Commands/LabelCommand.cs +++ b/src/GitReleaseManager.Core/Commands/LabelCommand.cs @@ -17,6 +17,14 @@ public LabelCommand(IVcsService vcsService, ILogger logger) public async Task ExecuteAsync(LabelSubOptions options) { + var vcsOptions = options as BaseVcsOptions; + + if (vcsOptions?.Provider == Model.VcsProvider.GitLab) + { + _logger.Error("The label command is currently not supported when targetting GitLab."); + return 1; + } + _logger.Information("Creating standard labels"); await _vcsService.CreateLabelsAsync(options.RepositoryOwner, options.RepositoryName).ConfigureAwait(false); diff --git a/src/GitReleaseManager.Core/VcsService.cs b/src/GitReleaseManager.Core/VcsService.cs index 0dcc9d27..2a5f88a7 100644 --- a/src/GitReleaseManager.Core/VcsService.cs +++ b/src/GitReleaseManager.Core/VcsService.cs @@ -151,7 +151,15 @@ private async Task AddAssetsAsync(string owner, string repository, string tagNam if (existingAsset != null) { _logger.Warning("Requested asset to be uploaded already exists on draft release, replacing with new file: {AssetPath}", asset); - await _vcsProvider.DeleteAssetAsync(owner, repository, existingAsset.Id).ConfigureAwait(false); + + if (_vcsProvider is GitLabProvider) + { + _logger.Error("Deleting of assets is not currently supported when targetting GitLab."); + } + else + { + await _vcsProvider.DeleteAssetAsync(owner, repository, existingAsset).ConfigureAwait(false); + } } var upload = new ReleaseAssetUpload