Skip to content

Commit 0588a50

Browse files
authored
Merge pull request #20 from openrails/feature/include-label
feat: Allow non-member PRs to be included with second label
2 parents bf43a40 + 885fe39 commit 0588a50

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Git/Project.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ public string CommitTree(string authorName, string authorEmail, string treeRef,
9393
{
9494
var tempFile = Path.GetTempFileName();
9595
File.WriteAllText(tempFile, message);
96-
try {
96+
try
97+
{
9798
Environment.SetEnvironmentVariable("GIT_AUTHOR_NAME", authorName);
9899
Environment.SetEnvironmentVariable("GIT_AUTHOR_EMAIL", authorEmail);
99100
Environment.SetEnvironmentVariable("GIT_COMMITTER_NAME", authorName);

Program.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Collections.Generic;
33
using System.IO;
44
using System.Linq;
@@ -63,8 +63,9 @@ static async Task AsyncMain(IConfigurationRoot config)
6363
Console.WriteLine($"Open pull requests ({pullRequests.Count}):");
6464
foreach (var pullRequest in pullRequests)
6565
{
66-
var autoMerge = memberLogins.Contains(pullRequest.Author?.Login)
67-
&& !pullRequest.Labels.Nodes.Any(label => label.Name == gitHubConfig["excludeLabel"]);
66+
var autoMerge =
67+
(memberLogins.Contains(pullRequest.Author?.Login) && !pullRequest.Labels.Nodes.Any(label => label.Name == gitHubConfig["excludeLabel"]))
68+
|| pullRequest.Labels.Nodes.Any(label => label.Name == gitHubConfig["includeLabel"]);
6869
Console.WriteLine($" #{pullRequest.Number} {pullRequest.Title}");
6970
Console.WriteLine($" By: {pullRequest.Author?.Login}");
7071
Console.WriteLine($" Branch: {pullRequest.HeadRef?.Name}");

0 commit comments

Comments
 (0)