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

[TRUNK-14370] Do not error on forbidden/unauthorized #443

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

cmillar-trunk
Copy link
Contributor

Changes our exit logic to not use error reporting on forbidden/unauthorized errors. While I was there, added a nudge to check your token.

Changes our exit logic to not use error reporting on
forbidden/unauthorized errors. While I was there, added a nudge to check
your token.
@cmillar-trunk cmillar-trunk requested a review from gnalh as a code owner February 27, 2025 22:06
Copy link

trunk-io bot commented Feb 27, 2025

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

Copy link

trunk-staging-io bot commented Feb 27, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Copy link

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Copy link

trunk-io bot commented Feb 27, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

cli/src/main.rs Outdated
if status == StatusCode::UNAUTHORIZED || status == StatusCode::FORBIDDEN {
tracing::warn!("Unauthorized to access trunk, are you sure your token is correct? {:?}", error);
guard.flush(None);
std::process::exit(exitcode::OK);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This might be a footgun when enabling trunk. If we exit success even though it's misconfigured you'll see the CI job succeed and assume all is well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair; I'll switch it to use the software exit code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants