Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore not existing FileCredentials instead of failing #279

Closed
froth opened this issue Aug 30, 2023 · 0 comments · Fixed by #280
Closed

Ignore not existing FileCredentials instead of failing #279

froth opened this issue Aug 30, 2023 · 0 comments · Fixed by #280

Comments

@froth
Copy link

froth commented Aug 30, 2023

The update to sbt-scalafmt to 2.5.1 broke our gitlab-ci build pipelines.
This happens because we use the following config in sbt:
credentials += Credentials(Path.userHome / ".sbt" / ".credentials.gitlab")
It loads credentials from a file for local development to access maven repos hosted in a local gitlab installation.
In pipeline runs this is not necessary as access is automatically provided.
sbt itself just ignores the missing file in the pipeline and logs [warn] Credentials file /root/.sbt/.credentials.gitlab does not exist.

sbt-scalafmt instead exits with an error. This is because it uses val cred = Credentials.toDirect(x) (which throws if loading fails). I would prefer using Credentials.loadCredentials to get a similar experience as sbt itself.

I can try to create a pull request if you want.

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 a pull request may close this issue.

1 participant