dotnet / dotnet/docker-tools

publishImageInfo command should not fail if there are no changes to push

Open
#1,515 2 comments 0 reactions 0 assignees View on GitHub
area-infrastructure
Dominant language
C#
Stars
181
Forks
67
Avg merge
2d 15h
Merged PRs (30d)
10

Description

When running a build that doesn't build any Dockerfiles due to everything being cached, the publish stage will fail when executing the `publishImageInfo` command:

```
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> LibGit2Sharp.EmptyCommitException: No changes; nothing to commit.
at LibGit2Sharp.Repository.Commit(String message, Signature author, Signature committer, CommitOptions options) in /_/LibGit2Sharp/Repository.cs:line 1081
at LibGit2Sharp.RepositoryExtensions.Commit(IRepository repository, String message, Signature author, Signature committer) in /_/LibGit2Sharp/RepositoryExtensions.cs:line 200
at Microsoft.DotNet.ImageBuilder.Commands.PublishImageInfoCommand.UpdateGitRepos(String repoPath, IRepository repo) in /image-builder/src/Commands/PublishImageInfoCommand.cs:line 91
at Microsoft.DotNet.ImageBuilder.Commands.PublishImageInfoCommand.ExecuteAsync() in /image-builder/src/Commands/PublishImageInfoCommand.cs:line 58
at Microsoft.DotNet.ImageBuilder.Commands.Command`2.b__9_0(TOptions options) in /image-builder/src/Commands/Command.TOptions.cs:line 46
```

Instead, it should just provide a warning.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.