check:forge

Introduction

check:forge checks that the forge user and token in your workspace .env work against the forge’s API. Run it before a release, or when a command that talks to the forge answers 401 or 403.

splent check:forge
git.splent.io Credentials Check

[✔] SPLENT_FORGE_USER = splent-dev
[✔] SPLENT_FORGE_TOKEN = 3f9a****0b1c

Contacting the git.splent.io API...
[✔] Authenticated as splent-dev
[✔] Name: Alex Rivera

Credentials for git.splent.io OK.

It checks the forge the workspace points at, git.splent.io by default or the host in SPLENT_FORGE_HOST. check:github is a hidden alias.


Checking github.com

With SPLENT_FORGE_HOST=github.com the variables are GITHUB_USER and GITHUB_TOKEN, and two more lines follow the name.

[✔] Plan: free
[✔] Rate limit: 4998/5000 remaining

Fixing a failed check

Line What to do
SPLENT_FORGE_USER not set in .env or SPLENT_FORGE_TOKEN not set in .env Set them with env:set forge
Token invalid or expired (401 Unauthorized) Create a new token
Token lacks required permissions (403 Forbidden) Give the token the write:repository scope, repo on github.com
Token belongs to '<login>', but SPLENT_FORGE_USER is '<user>' A warning. Fix the user or use your own token
Network error: <reason> The forge could not be reached. Check your connection and SPLENT_FORGE_HOST
No usable answer from <url>, ... SPLENT_FORGE_HOST, or SPLENT_FORGE_API when set, points at something that is not a forge

Every failure exits 1. splent tokens:setup explains how to get a token step by step.


Reference

Variable Description
SPLENT_FORGE_USER Your username on the forge. GITHUB_USER is read when it is unset
SPLENT_FORGE_TOKEN A forge access token. On git.splent.io create it under Settings, Applications, Access Tokens, with the write:repository and write:organization scopes, at git.splent.io/user/settings/applications. On github.com use a classic token with repo scope. GITHUB_TOKEN is read when it is unset

It calls GET /user on the forge API. The token goes only to the forge and never follows a redirect to another host. It prints masked, as **** under 12 characters and otherwise with at most its first and last four characters, never more than a quarter of it.

splent doctor runs it in its Credentials section.


Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es