Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

CLI returns 0 (success) exit code even if the action fails #255

@jdvor

Description

@jdvor

Returning non-zero exit code when the action has failed is the most basic behavior of command line tools which allows them to be composed in scripts, CI pipelines, etc.
Also. the issue is more aggravating because of #254 .

Example:
The package is already uploaded.

dotnet-octo push --package="Skeleton.App_alpine-x64.1.1.0.tar.gz" --overwrite-mode=FailIfExists --space="Default" --timeout=300 --outputFormat=Json
echo $?

Output:

Found space: Default (Spaces-1)
{
  "SuccessfulPackages": [],
  "FailedPackages": [
    {
      "Package": "/home/jan/dev/dotnet-daemon/artifacts/Skeleton.App_alpine-x64.1.1.0.tar.gz",
      "Reason": "There was a problem with your request.\n\n - A package with the same ID and version already exists. To proceed anyway, specify an overwriteMode of OverwriteExisting or IgnoreIfExists.\n"
    }
  ]
}
0

dotnet-octo --version
9.1.7

dotnet --info

.NET SDK:
 Version:   7.0.403
 Commit:    142776d834

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /usr/share/dotnet/sdk/7.0.403/

Host:
  Version:      7.0.13
  Architecture: x64
  Commit:       3f73a2f186

.NET SDKs installed:
  6.0.416 [/usr/share/dotnet/sdk]
  7.0.403 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.24 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.24 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  DOTNET_ROOT       [/usr/share/dotnet/]

global.json file:
  /home/jan/dev/dotnet-daemon/global.json

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions