@@ -11,7 +11,7 @@ public class DockerHubReadmePublish : FrostingTask<BuildContext>;
1111
1212[ TaskName ( nameof ( DockerHubReadmePublishInternal ) ) ]
1313[ TaskDescription ( "Publish the DockerHub updated README.md" ) ]
14- public class DockerHubReadmePublishInternal : FrostingTask < BuildContext >
14+ public class DockerHubReadmePublishInternal : AsyncFrostingTask < BuildContext >
1515{
1616 public override bool ShouldRun ( BuildContext context )
1717 {
@@ -24,20 +24,23 @@ public override bool ShouldRun(BuildContext context)
2424 return shouldRun ;
2525 }
2626
27- public override void Run ( BuildContext context )
27+ public override async Task RunAsync ( BuildContext context )
2828 {
2929 ArgumentNullException . ThrowIfNull ( context . Credentials ? . DockerHub ) ;
3030 var readme = GetReadmeContent ( context ) ;
31+
32+ context . Information ( "Publishing README.md to DockerHub" ) ;
3133
32- var response = context . HttpPost ( "https://hub.docker.com/v2/users/login" , settings =>
34+ context . Information ( "Logging in to DockerHub" ) ;
35+ var response = await context . HttpPostAsync ( "https://hub.docker.com/v2/users/login" , settings =>
3336 {
3437 var credentials = context . Credentials . DockerHub ;
3538 settings
3639 . SetContentType ( "application/json" )
3740 . SetJsonRequestBody ( new { username = credentials . Username , password = credentials . Password } ) ;
3841 } ) ;
3942
40-
43+ context . Information ( "Updating README.md on DockerHub" ) ;
4144 context . HttpPatch ( "https://hub.docker.com/v2/repositories/gittools/gitversion" , settings =>
4245 {
4346 var token = context . ParseJson ( response ) . Value < string > ( "token" ) ;
@@ -46,6 +49,7 @@ public override void Run(BuildContext context)
4649 . SetAuthorization ( "JWT" , token )
4750 . SetJsonRequestBody ( new { full_description = readme } ) ;
4851 } ) ;
52+ context . Information ( "README.md updated on DockerHub" ) ;
4953 }
5054
5155 private static string GetReadmeContent ( BuildContextBase context )
0 commit comments