Skip to content
Merged
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
7 changes: 5 additions & 2 deletions .github/workflows/auto-merge-content-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ jobs:
permissions:
contents: read
pull-requests: write
env:
MAX_FILES: 2
outputs:
is-small-change: ${{ steps.analyse-changes.outputs.is-small-change }}
max-files: ${{ env.MAX_FILES }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -40,7 +43,7 @@ jobs:
$baseBranch = "main"
}

$maxFiles = 2
$maxFiles = [int]$env:MAX_FILES
$changedFiles = git diff --name-only origin/$baseBranch...HEAD
$contentFiles = $changedFiles | Where-Object { $_ -like "content/*" -or $_ -like "public/*" }
$nonContentFiles = $changedFiles | Where-Object { $_ -notlike "content/*" -and $_ -notlike "public/*" }
Expand All @@ -66,7 +69,7 @@ jobs:

This PR has been analyzed for auto-merge eligibility based on:
- Content-only changes
- Maximum ${{ $maxFiles }} file${{ $maxFiles > 1 && 's' || '' }} changed
- Maximum ${{ env.MAX_FILES }} file${{ env.MAX_FILES > 1 && 's' || '' }} changed
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pluralization logic uses incorrect syntax. GitHub Actions expressions don't support the &&/|| ternary operator syntax. This should use proper GitHub Actions ternary syntax: ${{ env.MAX_FILES > 1 && 's' || '' }} should be ${{ env.MAX_FILES > 1 && 's' || '' }} which still won't work.

The correct syntax is:

- Maximum ${{ env.MAX_FILES }} file${{ fromJSON(env.MAX_FILES) > 1 && 's' || '' }} changed

Or alternatively, using the proper ternary format:

- Maximum ${{ env.MAX_FILES }} file${{ fromJSON(env.MAX_FILES) > 1 && 's' }} changed

Note: env.MAX_FILES is a string, so you need fromJSON() to convert it to a number for comparison.

Suggested change
- Maximum ${{ env.MAX_FILES }} file${{ env.MAX_FILES > 1 && 's' || '' }} changed
- Maximum ${{ env.MAX_FILES }} file${{ fromJSON(env.MAX_FILES) > 1 && 's' }} changed

Copilot uses AI. Check for mistakes.
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: true

Expand Down
Loading