Skip to content

Commit

Permalink
No longer need DependabotUpdateJobDefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell committed Sep 19, 2023
1 parent c354692 commit 0b8d18d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@

namespace Tingle.Dependabot.Models;

public sealed class DependabotUpdateJobDefinition
{
[JsonPropertyName("job")]
public required JsonObject? Job { get; set; }

[JsonPropertyName("credentials")]
public required JsonArray Credentials { get; set; }
}

public sealed class CreatePullRequestModel
{
[Required]
Expand Down
6 changes: 3 additions & 3 deletions server/Tingle.Dependabot/Workflow/UpdateRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ internal async Task<string> WriteJobDefinitionAsync(RepositoryUpdate update,
var url = options.ProjectUrl!.Value;
var credentialsMetadata = MakeCredentialsMetadata(credentials);

var definition = new DependabotUpdateJobDefinition
var definition = new JsonObject
{
Job = new JsonObject
["job"] = new JsonObject
{
["allowed-updates"] = ToJsonNode(update.Allow ?? new()),
["credentials-metadata"] = ToJsonNode(credentialsMetadata).AsArray(),
Expand Down Expand Up @@ -320,7 +320,7 @@ internal async Task<string> WriteJobDefinitionAsync(RepositoryUpdate update,
["security-updates-only"] = update.OpenPullRequestsLimit == 0,
["debug"] = false,
},
Credentials = ToJsonNode(credentials).AsArray(),
["credentials"] = ToJsonNode(credentials).AsArray(),
};

// write the job definition file
Expand Down

0 comments on commit 0b8d18d

Please sign in to comment.