Skip to content

Fix copilot-setup-steps.yml#37497

Merged
roji merged 1 commit into
dotnet:mainfrom
roji:SqlServerOnAgent
Jan 13, 2026
Merged

Fix copilot-setup-steps.yml#37497
roji merged 1 commit into
dotnet:mainfrom
roji:SqlServerOnAgent

Conversation

@roji

@roji roji commented Jan 13, 2026

Copy link
Copy Markdown
Member

No description provided.

@roji
roji force-pushed the SqlServerOnAgent branch from 434e1c8 to 83c327b Compare January 13, 2026 13:13
@roji
roji marked this pull request as ready for review January 13, 2026 13:14
@roji
roji requested a review from a team as a code owner January 13, 2026 13:14
Copilot AI review requested due to automatic review settings January 13, 2026 13:14
@roji
roji merged commit d15ee81 into dotnet:main Jan 13, 2026
6 of 11 checks passed
@roji
roji deleted the SqlServerOnAgent branch January 13, 2026 13:14

Copilot AI left a comment

Copy link
Copy Markdown

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 attempts to fix the SQL Server health check command in the GitHub Actions workflow by changing how the SA password is referenced from using \$SA_PASSWORD (escaped environment variable reference) to ${{ secrets.MSSQL_SA_PASSWORD }} (GitHub Actions secret interpolation).

Changes:

  • Modified the Docker health-cmd option to use GitHub Actions secret syntax instead of container environment variable reference

- 1433:1433
options: >-
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P \$SA_PASSWORD -Q \"SELECT 1\" -C"
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P '${{ secrets.MSSQL_SA_PASSWORD }}' -Q 'SELECT 1' -C"

Copilot AI Jan 13, 2026

Copy link

Choose a reason for hiding this comment

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

Using GitHub secrets directly in the health-cmd option can expose the password in Docker container logs and process listings. The original approach using $SA_PASSWORD was attempting to reference the environment variable SA_PASSWORD (defined on line 29) from within the container context. The correct fix would be to use proper escaping to reference the container's environment variable, such as --health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "$SA_PASSWORD" -Q "SELECT 1" -C" or consider using a health check script that doesn't expose credentials in command arguments.

Suggested change
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P '${{ secrets.MSSQL_SA_PASSWORD }}' -Q 'SELECT 1' -C"
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P \"\$SA_PASSWORD\" -Q \"SELECT 1\" -C"

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