Skip to content

Running 'safety scan' in CI environment produces login/register prompt #857

Description

@andy-maier

Checklist

  • I agree to the terms within the Safety Code of Conduct.
  • I have searched existing issues to ensure this bug hasn't been reported before.

Safety version

3.7.0

Python version

3.12

Operating System

macOS 15

Bug description

Running 'safety scan' in a CI environment such as GitHub Actions results in the login/register prompt:

bash -c "safety scan --policy-file .safety-policy-install.yml --full-report || test 'normal' == 'normal' || exit 1"
/opt/hostedtoolcache/Python/3.14.4/x64/lib/python3.14/site-packages/authlib/_joserfc_helpers.py:8: AuthlibDeprecationWarning: authlib.jose module is deprecated, please use joserfc instead.
It will be compatible before version 2.0.0.
  from authlib.jose import ECKey

Please login or register Safety CLI (free forever) to scan and secure your 
projects with Safety

(R)egister for a free account in 30 seconds, or (L)ogin with an existing account
Unhandled exception happened: EOF when reading a line
to continue (R/L): 

Example of a Actions log file with this: https://github.com/pywbem/pywbem/actions/runs/25271512588/job/74094634988

Since the CI environment has no terminal, the prompting gets EOF and retries.

This prevents the scan to actually run and currently renders the "safety scan" command useless for us.

The old "safety check" command did not have that behavior.

Is there a way to deal with that in a CI environment?

Can the requirement to log in be removed?

Steps to reproduce

Use "safety scan" in a CI environment

Command and output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates a problem that needs to be resolved.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions