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
5 changes: 3 additions & 2 deletions LabelModule/LabelModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ public override void Execute(PullRequestContext builder)
{
builder.OnBody(async () =>
{
Console.WriteLine($"Executing labeller on {PullRequest.Body}");
List<string> tagsToRemove = new();
List<string> tagsToAdd = new();
foreach (string tag in Config.TagLabels)
{
if (PullRequest.Body.Contains(tag))
if (PullRequest.Body.Contains(tag, StringComparison.CurrentCultureIgnoreCase))
{
tagsToAdd.Add(tag);
}
Expand All @@ -27,7 +28,7 @@ public override void Execute(PullRequestContext builder)
tagsToRemove.Add(tag);
}
}
foreach (string? badTag in tagsToRemove.Where(y => PullRequest.Labels.Any(x => x.Name == y)))
foreach (string? badTag in tagsToRemove.Where(y => PullRequest.Labels.Any(x => string.Equals(x.Name, y, StringComparison.CurrentCultureIgnoreCase))))
{
await Client.Issue.Labels.RemoveFromIssue(OurRepositoryID, PullRequest.Number, badTag);
}
Expand Down
35 changes: 25 additions & 10 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,31 +90,46 @@ inputs:
runs:
using: "composite"
steps:
# Cache NuGet packages
- name: Cache NuGet
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj') }}
restore-keys: |
nuget-${{ runner.os }}-

# Cache build output
- name: Cache build output
uses: actions/cache@v4
with:
path: Runner/bin
key: build-${{ runner.os }}-${{ hashFiles('Runner/**/*.cs', 'Runner/**/*.csproj') }}
key: build-${{ runner.os }}-${{ hashFiles('**/*.cs', '**/*.csproj') }}
restore-keys: |
build-${{ runner.os }}-

# Check if DLL exists
- name: Check build output
id: check_dll
shell: bash
run: |
if [ -f "Runner/bin/Release/net8.0/Runner.dll" ]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi

# Cache NuGet packages
- name: Cache NuGet
if: steps.check_dll.outputs.exists != 'true'
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj') }}
restore-keys: |
nuget-${{ runner.os }}-

# Restore (fast when cached)
- name: Restore
if: steps.check_dll.outputs.exists != 'true'
run: dotnet restore ./Runner/Runner.csproj
shell: bash

# Build (skipped if unchanged)
# Build only if missing
- name: Build
if: steps.check_dll.outputs.exists != 'true'
run: dotnet build ./Runner/Runner.csproj -c Release --no-restore
shell: bash

Expand Down