You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support masking credentials in remote include URLs #2972
Includes are resolved before variables are compiled, so {{.TOKEN}} is replaced by the literal string {{.CI_JOB_TOKEN}} rather than the token. Only environment variables and static Taskfile variables are available at that point.
And secret: true only masks logged commands, task --summary and command output, never the include URL.
So the credential has to be referenced directly, private_token={{.CI_JOB_TOKEN}}, which is exactly the form that leaks.
url.Redacted() does not cover it either. It masks the password of the userinfo, so https://user:{{.TOKEN}}@host/... is handled but not https://{{.TOKEN}}@host/..., the form our own docs recommend, where the token is the username. Query parameters are never touched either.
Why not just mask every variable in the URL
Because most of them are worth reading. A typical GitLab URL carries {{.CI_PROJECT_ID}}, {{.CI_COMMIT_REF_NAME}} and {{.CI_JOB_TOKEN}}, three variables, one secret.
What can we do ?
An explicit list of variable names to hide, configured next to trusted-hosts:
# .taskrc.ymlremote:
mask-vars:
- CI_JOB_TOKEN
with TASK_REMOTE_MASK_VARS as equivalent.
task: Download of "https://gitlab.com/.../raw?ref=main&private_token=*****" failed
Activity
trulede commentedon Aug 15, 2026
I would suggest that the includes support a list (map) of headers which the underlying mechanism appends to a request.
olifarhaan commentedon Aug 20, 2026
@vmaerten is it open for contribution?