Extract maxFiles to job-level environment variable#4378
Extract maxFiles to job-level environment variable#4378wicksipedia merged 2 commits intofeature/auto-merge-small-changesfrom
Conversation
Co-authored-by: wicksipedia <600044+wicksipedia@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors the maxFiles variable in the GitHub Actions workflow from a hardcoded PowerShell variable to a job-level environment variable, fixing scope issues and improving maintainability.
Key Changes:
- Introduced
MAX_FILES: 2as a job-level environment variable for centralized configuration - Updated PowerShell script to read from
$env:MAX_FILESwith proper type conversion - Fixed GitHub Actions context reference in PR comment from undefined
$maxFilesto${{ env.MAX_FILES }}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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 |
There was a problem hiding this comment.
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' || '' }} changedOr alternatively, using the proper ternary format:
- Maximum ${{ env.MAX_FILES }} file${{ fromJSON(env.MAX_FILES) > 1 && 's' }} changedNote: env.MAX_FILES is a string, so you need fromJSON() to convert it to a number for comparison.
| - Maximum ${{ env.MAX_FILES }} file${{ env.MAX_FILES > 1 && 's' || '' }} changed | |
| - Maximum ${{ env.MAX_FILES }} file${{ fromJSON(env.MAX_FILES) > 1 && 's' }} changed |
Addresses review feedback to extract the
maxFilesPowerShell variable to a job-level environment variable, making it properly accessible throughout the workflow.Changes:
MAX_FILES: 2as job-level environment variable indetect-small-changesjob$env:MAX_FILESinstead of hardcoded value${{ env.MAX_FILES }}(previously referenced undefined$maxFilesin GitHub Actions context)Before:
After:
Affected routes: N/A (GitHub Actions workflow only)
If adding a new page, I have followed the 📃 New Webpage issue template
If updating the livestream banner, I have tested and followed the steps in Wiki - Testing the live banner
Include Done Video or screenshots
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.