Skip to content

Commit

Permalink
Feature/test (#162)
Browse files Browse the repository at this point in the history
* Debug

* Debug
  • Loading branch information
guibranco authored Feb 18, 2024
1 parent 5d889f0 commit 8463e9d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Src/pullRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ function handlePullRequest($pullRequest)

$referencedIssueResponse = requestGitHub($metadata["token"], "graphql", $referencedIssueQuery);
$referencedIssue = json_decode($referencedIssueResponse["body"]);
print_r($referencedIssue);

if (count($referencedIssue->data->repository->pullRequest->closingIssuesReferences->nodes) > 0) {
$issueNumber = $referencedIssue->data->repository->pullRequest->closingIssuesReferences->nodes[0]->number;
$issueResponse = requestGitHub($metadata["token"], $metadata["issuesUrl"] . "/" . $issueNumber);

$labels = array_column(json_decode($issueResponse["body"])->labels, "name");
echo "Labels: \n";
print_r($labels);
$body = array("labels" => array("WIP"));
requestGitHub($metadata["token"], $metadata["issuesUrl"] . "/" . $issueNumber . "/labels", $labels);
$body = array("labels" => $labels);
Expand Down

0 comments on commit 8463e9d

Please sign in to comment.