Skip to content

Commit f773d7a

Browse files
CopilotPhantomDave
andauthored
Scope lint auto-commits to PRs targeting main (#168)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com>
1 parent 23e4c9a commit f773d7a

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

.github/workflows/backend-api.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ jobs:
3333
run: dotnet restore PhantomDave.BankTracking.Api/PhantomDave.BankTracking.Api.csproj
3434

3535
- name: Format code
36+
if: ${{ github.event.pull_request.base.ref == 'main' }}
3637
run: dotnet format PhantomDave.BankTracking.Api/PhantomDave.BankTracking.Api.csproj --verbosity diagnostic
3738

3839
- name: Commit formatted code
40+
if: ${{ github.event.pull_request.base.ref == 'main' }}
3941
uses: stefanzweifel/git-auto-commit-action@v7
40-
if: github.event_name == 'push'
4142
with:
4243
commit_message: "chore: auto-format Backend API code"
4344
file_pattern: "PhantomDave.BankTracking.Api/**"

.github/workflows/backend-data.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ jobs:
3232
run: dotnet restore PhantomDave.BankTracking.Data/PhantomDave.BankTracking.Data.csproj
3333

3434
- name: Format code
35+
if: ${{ github.event.pull_request.base.ref == 'main' }}
3536
run: dotnet format PhantomDave.BankTracking.Data/PhantomDave.BankTracking.Data.csproj --verbosity diagnostic
3637

3738
- name: Commit formatted code
39+
if: ${{ github.event.pull_request.base.ref == 'main' }}
3840
uses: stefanzweifel/git-auto-commit-action@v7
39-
if: github.event_name == 'push'
4041
with:
4142
commit_message: "chore: auto-format Backend Data code"
4243
file_pattern: "PhantomDave.BankTracking.Data/**"

.github/workflows/backend-library.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ jobs:
3131
run: dotnet restore PhantomDave.BankTracking.Library/PhantomDave.BankTracking.Library.csproj
3232

3333
- name: Format code
34+
if: ${{ github.event.pull_request.base.ref == 'main' }}
3435
run: dotnet format PhantomDave.BankTracking.Library/PhantomDave.BankTracking.Library.csproj --verbosity diagnostic
3536

3637
- name: Commit formatted code
38+
if: ${{ github.event.pull_request.base.ref == 'main' }}
3739
uses: stefanzweifel/git-auto-commit-action@v7
38-
if: github.event_name == 'push'
3940
with:
4041
commit_message: "chore: auto-format Backend Library code"
4142
file_pattern: "PhantomDave.BankTracking.Library/**"

.github/workflows/frontend.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ jobs:
7171
working-directory: ./frontend
7272
run: bun run codegen
7373

74+
- name: Lint and fix
75+
if: ${{ github.event.pull_request.base.ref == 'main' }}
76+
working-directory: ./frontend
77+
run: bun run lint:fix
78+
79+
- name: Commit lint fixes
80+
if: ${{ github.event.pull_request.base.ref == 'main' }}
81+
uses: stefanzweifel/git-auto-commit-action@v7
82+
with:
83+
commit_message: "chore: auto-fix frontend lint"
84+
file_pattern: "frontend/**"
85+
7486
- name: Build
7587
working-directory: ./frontend
7688
run: bun run build -- --configuration=development

PhantomDave.BankTracking.Api/Services/FileImportService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,12 @@ public IEnumerable<FinanceRecord> FromParsedData(int accountId, ParsedFileData p
331331
private static string NormalizeCurrency(string currency)
332332
{
333333
var normalized = currency.Trim().ToUpperInvariant();
334-
334+
335335
if (normalized.Length < 1 || normalized.Length > 3)
336336
{
337337
return "USD";
338338
}
339-
339+
340340
return normalized;
341341
}
342342
}

0 commit comments

Comments
 (0)