From 3129761108ef8e9aee51f980552ee3610e770e15 Mon Sep 17 00:00:00 2001 From: Sergio Campama Date: Sat, 7 May 2022 01:59:57 -0400 Subject: [PATCH] test --- Sources/copilot-action/PRSizeLabeler.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/copilot-action/PRSizeLabeler.swift b/Sources/copilot-action/PRSizeLabeler.swift index a67f5f2..5cb8e8e 100644 --- a/Sources/copilot-action/PRSizeLabeler.swift +++ b/Sources/copilot-action/PRSizeLabeler.swift @@ -2,9 +2,13 @@ import ArgumentParser import APIBuilder import Foundation -struct PullRequestEvent: Codable { +struct PullRequest: Codable { let additions: Int let deletions: Int +} +struct PullRequestEvent: Codable { + + let pull_request: PullRequest let number: Int } @@ -56,7 +60,7 @@ struct PRSizeLabeler: AsyncParsableCommand { let pullRequestEvent = try JSONDecoder().decode(PullRequestEvent.self, from: eventData) - print("The pull has \(pullRequestEvent.additions + pullRequestEvent.deletions) changed lines") + print("The pull has \(pullRequestEvent.pull_request.additions + pullRequestEvent.pull_request.deletions) changed lines") let provider = APIProvider(configuration: GithubConfiguration(token: githubToken)) let body = LabelsChangeRequest(labels: ["XS"])