Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/self_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ jobs:
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
tagLabels: bug,documentation,enhancement
enableReviewLabel: true
7 changes: 6 additions & 1 deletion ReviewModule/ReviewModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ public ReviewModule(GitHubClient client, Config config, long repositoryID, PullR

public override void Execute(PullRequestContext builder)
{
if (!Config.EnableReviewLabel)
{
return;
}

builder.AddDynamicContent("REVIEW", () =>
{
// Determine if we have any PRs open that already have the label.
Expand All @@ -34,7 +39,7 @@ public override void Execute(PullRequestContext builder)
await Client.Issue.Comment.Delete(OurRepositoryID, comment.Id);

// Not the author
if (comment.AuthorAssociation != AuthorAssociation.Owner)
if (comment.User.Login != PullRequest.User.Login)
{
return;
}
Expand Down
5 changes: 0 additions & 5 deletions Runner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@
return 1;
}

Console.WriteLine(File.ReadAllText(parsedFile.FullName));
Console.WriteLine(File.ReadAllText(inputFile.FullName));

// Parse the json file
JObject json = JObject.Parse(File.ReadAllText(parsedFile.FullName));
if (!json.TryGetValue("action", out JToken? action))
Expand All @@ -72,8 +69,6 @@

Config inputs = new(githubToken, inputsJson ?? JObject.Parse("{}"));

Console.WriteLine($"{inputs}");

// Convert the token to a string
string actionText = action.ToString();

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
enableReviewLabel:
description: "Whether review labels should be enabled"
required: false
default: "false"
default: "true"

createPRCommentBase:
description: "Base message posted when a pull request is created"
Expand Down