Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

Addresses review feedback to extract the maxFiles PowerShell variable to a job-level environment variable, making it properly accessible throughout the workflow.

Changes:

  • Added MAX_FILES: 2 as job-level environment variable in detect-small-changes job
  • Updated PowerShell script to read from $env:MAX_FILES instead of hardcoded value
  • Fixed comment step to use ${{ env.MAX_FILES }} (previously referenced undefined $maxFiles in GitHub Actions context)
  • Exposed as job output for potential cross-job usage

Before:

run: |
  $maxFiles = 2
  # ...later in different step
  message: |
    - Maximum ${{ $maxFiles }} file...  # ❌ undefined in Actions context

After:

env:
  MAX_FILES: 2
outputs:
  max-files: ${{ env.MAX_FILES }}
steps:
  run: |
    $maxFiles = [int]$env:MAX_FILES
    # ...later in different step
    message: |
      - Maximum ${{ env.MAX_FILES }} file...  # ✅ properly scoped
  • 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.

Copilot AI changed the title [WIP] Update to extract maxFiles to a job-level environment variable Extract maxFiles to job-level environment variable Dec 9, 2025
Copilot AI requested a review from wicksipedia December 9, 2025 23:50
@wicksipedia wicksipedia marked this pull request as ready for review December 9, 2025 23:51
Copilot AI review requested due to automatic review settings December 9, 2025 23:51
@wicksipedia wicksipedia merged commit da386dc into feature/auto-merge-small-changes Dec 9, 2025
2 checks passed
@wicksipedia wicksipedia deleted the copilot/sub-pr-4108 branch December 9, 2025 23:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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: 2 as a job-level environment variable for centralized configuration
  • Updated PowerShell script to read from $env:MAX_FILES with proper type conversion
  • Fixed GitHub Actions context reference in PR comment from undefined $maxFiles to ${{ 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
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants