Skip to content

Add password input#87

Merged
davidmfinol merged 1 commit intogame-ci:mainfrom
monumentalco:main
Nov 15, 2025
Merged

Add password input#87
davidmfinol merged 1 commit intogame-ci:mainfrom
monumentalco:main

Conversation

@Rycieos
Copy link
Contributor

@Rycieos Rycieos commented Jul 18, 2025

Changes

Unless I am missing something, when using TOTP, a password is required to login. It could be that both steamcmd and this action are missing some details in the documentation, but I can find no way to login to steamcmd with only a username and a TOTP code.

While steamcmd is perfectly fine with accepting the password as part of the username input (separated with a space), the way this action is set up, the second steamcmd invocation where the upload happens would then also use the password, causing steamcmd to error because the password was provided without the TOTP code.

Rather than use the TOTP code there again (as proposed in #86), add the password in the test step (which will cache the credentials), and withhold it from the upload step.

In the configVdf case, the password will be empty, and steamcmd will ignore it, keeping the previous mechanics.

This is a much simpler solution than #86 to the same problem.

Checklist

  • Read the contribution guide and accept the code of conduct
  • Readme (updated)
  • Tests (not needed)

Summary by CodeRabbit

  • New Features
    • Added support for providing a password when authenticating with a Steam Build Account, required when using a TOTP code.
  • Documentation
    • Updated documentation to describe the new password configuration parameter and its usage requirements.

When using TOTP, a password is required to login. While steamcmd is
perfectly fine with accepting the password as part of the username input
(separated with a space), the way this action is set up, the second
steamcmd invocation where the upload happens would then also use the
password, causing steamcmd to error because the password was provided
without the TOTP code.

Rather than use the TOTP code there again (as proposed in game-ci#86), add the
password in the test step (which will cache the credentials), and retain
it from the upload step.

In the configVdf case, the password will be empty, and steamcmd will
ignore it, keeping the previous mechanics.
@coderabbitai
Copy link

coderabbitai bot commented Jul 18, 2025

Walkthrough

A new password parameter was introduced for Steam authentication, reflected in the documentation, action configuration, and deployment script. The action now optionally accepts a password, passes it as an environment variable, and includes it in the Steam login command when totp is used, clarifying authentication requirements.

Changes

File(s) Change Summary
README.md Documented the new password configuration parameter and clarified its required usage with totp.
action.yml Added an optional password input and the corresponding steam_password environment variable.
steam_deploy.sh Modified the Steam login command to include the password argument when logging in.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHubAction
    participant DockerContainer
    participant SteamCMD

    User->>GitHubAction: Provide username, totp, (optional) password
    GitHubAction->>DockerContainer: Set env vars (username, totp, password)
    DockerContainer->>SteamCMD: Run steamcmd +set_steam_guard_code +login username password
    SteamCMD-->>DockerContainer: Authentication result
    DockerContainer-->>GitHubAction: Continue deployment flow
Loading

Suggested reviewers

  • GabLeRoux

Poem

A password hops into the code,
With TOTP, it shares the load.
Now Steam unlocks with double keys,
Deployments flow with greater ease.
The script now knows just what to do—
Thank you, team, for seeing it through!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
README.md (1)

84-87: Add explicit guidance on storing the password securely

The new password input is inherently sensitive but the docs don’t explicitly call out that it must be provided via a GitHub Secret (similar to the many other secret parameters mentioned). Consider adding a short sentence such as “Store this value in a GitHub Secret (e.g. STEAM_PASSWORD) and reference it via ${{ secrets.STEAM_PASSWORD }}.”

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2d5b9ce and 7633162.

📒 Files selected for processing (3)
  • README.md (1 hunks)
  • action.yml (2 hunks)
  • steam_deploy.sh (1 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
steam_deploy.sh

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

(SC2154)


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

(SC2154)

🔇 Additional comments (2)
action.yml (2)

9-12: Enforce “password required when totp is set” at action level

Declaring password as required: false is fine, but users can still provide totp without password, leading to a runtime failure.
Consider adding a lightweight validation step (composite run or early check in steam_deploy.sh) that aborts with a clear message when totp is supplied and password is empty.


100-101: Consistent env-var naming conventions

steam_username/steam_totp use snake-case, so does steam_password – great. Just flagging that sticking to this pattern avoids surprises in the shell script; no action needed.

Comment on lines +141 to 142
steamcmd +set_steam_guard_code "$steam_totp" +login "$steam_username" "$steam_password" +quit;

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.

@kflorence
Copy link

Thanks, I just spent a few hours wondering about this as well and ended up here with the same conclusion. Baffling how this isn't mentioned anywhere...

Copy link
Member

@davidmfinol davidmfinol left a comment

Choose a reason for hiding this comment

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

I somehow didn't see this PR when it was first raised, but this approach looks good to me!
Apologies for the late reply, and thanks for the contribution!

@davidmfinol davidmfinol merged commit 288ee30 into game-ci:main Nov 15, 2025
1 check passed
@davidmfinol davidmfinol mentioned this pull request Nov 15, 2025
3 tasks
@kflorence
Copy link

Looks like the .vdf needs to be re-generated for the pipeline to pass

@coderabbitai coderabbitai bot mentioned this pull request Nov 16, 2025
3 tasks
@davidmfinol
Copy link
Member

Updated and released in https://github.com/game-ci/steam-deploy/releases/tag/v3.2.0

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.

3 participants