Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ jobs:

The username of the Steam Build Account that you created in setup step 1.

#### password

The password of the Steam Build Account. Both this and `totp` are required together, see below.

#### totp

Deploying to Steam using TOTP. If this is not passed, `configVdf` is required.
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ inputs:
required: true
default: ''
description: 'The username of your builder account.'
password:
required: false
description: 'The password of your builder account. Required if `totp` is set.'
totp:
required: false
description: 'The TOTP to use for login. If set, `configVdf` will be ignored.'
Expand Down Expand Up @@ -94,6 +97,7 @@ runs:
image: Dockerfile
env:
steam_username: ${{ inputs.username }}
steam_password: ${{ inputs.password }}
steam_totp: ${{ inputs.totp }}
configVdf: ${{ inputs.configVdf }}
appId: ${{ inputs.appId }}
Expand Down
2 changes: 1 addition & 1 deletion steam_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ echo "# Test login #"
echo "#################################"
echo ""

steamcmd +set_steam_guard_code "$steam_totp" +login "$steam_username" +quit;
steamcmd +set_steam_guard_code "$steam_totp" +login "$steam_username" "$steam_password" +quit;

Comment on lines +141 to 142
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid passing an empty string as the password & silence set -u pitfalls

With set -u enabled, "$steam_password" is fine if the variable is defined (empty is okay) – but SteamCMD treats +login user "" differently from +login user.
A safer pattern is to only append the password argument when it is non-empty:

-if [ -n "$steam_password" ]; then
-  steamcmd +set_steam_guard_code "$steam_totp" +login "$steam_username" "$steam_password" +quit
-else
-  steamcmd +set_steam_guard_code "$steam_totp" +login "$steam_username" +quit
-fi
+if [ -n "$steam_password" ]; then
+  steamcmd +set_steam_guard_code "$steam_totp" +login "$steam_username" "$steam_password" +quit
+else
+  steamcmd +set_steam_guard_code "$steam_totp" +login "$steam_username" +quit
+fi

This prevents accidental “blank-password” logins and keeps the script robust even if callers omit the new input.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 141-141: steam_username is referenced but not assigned.

(SC2154)


[warning] 141-141: steam_password is referenced but not assigned.

(SC2154)

🤖 Prompt for AI Agents
In steam_deploy.sh around lines 141 to 142, the script currently passes the
password argument to steamcmd even if it is an empty string, which SteamCMD
treats differently than omitting the password. To fix this, modify the script to
conditionally append the password argument only if the variable is non-empty,
ensuring no empty password is passed. This will prevent accidental
blank-password logins and avoid issues with set -u when the variable is
undefined.

ret=$?
if [ $ret -eq 0 ]; then
Expand Down