Repository navigation
Conversation
The action runs SQL Server setup with windowsVerbatimArguments, where
@actions/exec adds no quoting, and it wrapped the password as
`/SAPWD="${password}"` without escaping. A double quote in the
password, or a backslash at the end of it, therefore changed how setup
split its command line. Setup then lost the licence switch and every
later argument, or set a different password from the one in the
sa-password output, so later logins failed.
Quote the values that the action adds to the command line itself
(/SAPWD, /SQLCOLLATION and /UpdateSource) with the standard Windows
quoting rules, which escape each double quote and double the
backslashes that come before a double quote or the closing quote.
Plain values give the same command line as before. The user's
install-arguments are still passed as they are given.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The action never registered the password as a secret. @actions/exec prints each command line before it runs it, so the setup command line and every sqlcmd readiness attempt showed the password in clear when it didn't come from a secret, and so did later steps that printed it. Register the password with core.setSecret before anything can log it, and also its escaped form, which is what the command lines show when the password needs escaping. The README now says what masking covers: GitHub still shows the input in the step header before the action starts, and it leaves out job outputs that contain a masked value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a runaction job that installs SQL Server 2025 with an SA password that contains a double quote, a space, characters that cmd.exe treats specially and a trailing backslash. The check step logs in over TCP with the sa-password output, so the job passes only if setup set exactly that password. 2025 exits with 3010 in CI, so the action's own readiness check must also log in with it. The other jobs keep the action's default password. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The action runs SQL Server setup with
windowsVerbatimArguments, so@actions/execadds no quoting, and it wrapped the password as/SAPWD="${password}"without escaping. A double quote insa-password, or a backslash at the end of it, changed how setup split its command line. Setup then lost the licence switch and the later arguments, or set a different password from the one in thesa-passwordoutput. The password was also never masked, so the setup command line and everysqlcmdreadiness attempt printed it in clear when it didn't come from a secret.quoteWindowsArgument()quotes a value with the standard Windows quoting rules: it escapes each double quote, and doubles only the backslashes that come before a double quote or the closing quote. The action uses it for the values it adds itself:/SAPWD,/SQLCOLLATIONand/UpdateSource. Plain values give the same command line as before. The user'sinstall-argumentsare still passed as given. A unit test splits the command line the way the Windows C runtime does, and checks that every string of up to four characters froma " \ space tab % ^ !comes back unchanged, with the later switches intact.gatherInputs()registers the password withcore.setSecret, and also its escaped form, which is what the command lines show when the password needs escaping. This includes the public default password. GitHub leaves out job outputs that contain a masked value, so a workflow that passessa-passwordon as a job output loses it. Step outputs still work. The README says this, and also that GitHub still prints the inputs in the step header before the action starts.Str0ng"Pa ss%^!\, which contains a double quote, a space, characters thatcmd.exetreats specially and a trailing backslash. The check step from ci: check that the installed instance works in runaction #344 logs in over TCP with thesa-passwordoutput, so the job passes only if setup set exactly that password. 2025 exits with 3010 in CI, so the action's own readiness check must also log in with it.Closes #324
🤖 Generated with Claude Code