Repository navigation
Conversation
ahal
force-pushed
the
ahal/krpvwwsmzzts
branch
from
November 13, 2026 15:06
276e1ca to
1f70b10
Compare
A RUN_TASK_SECRETS entry of type 'secret' fetches a secret from Taskcluster's secrets service. It exports the secret, or one of its keys, to an environment variable, or writes it to a file only the task's user can read. Unlike github-repo-token, a failure to fetch the secret fails the task, since a task that asks for a secret can't do without it.
Tasks using the run transforms can list secrets for run-task to fetch in a 'secrets' key, rather than writing RUN_TASK_SECRETS by hand. The new use_secrets transform serializes the list into RUN_TASK_SECRETS, adds the scopes each secret needs, and enables the taskcluster proxy. A github-repo-token's repo defaults to the base_repository parameter.
The codecov and push-image tasks fetched their secrets themselves. List them in 'secrets' instead, so run-task fetches them and the transforms add the scopes. The codecov uploader now reads its token from CODECOV_TOKEN. push-image gets its auth file written by run-task, which also fixes a fetch failure going unnoticed until skopeo tried to use the bad file.
ahal
force-pushed
the
ahal/krpvwwsmzzts
branch
from
November 13, 2026 15:16
1f70b10 to
f84bc03
Compare
hneiva
reviewed
Nov 13, 2026
| The environment variable to export the secret in. | ||
| ``file`` | ||
| The file to write the secret to. Relative paths are relative to the | ||
| task's working directory. Missing parent directories are created, and on |
Contributor
There was a problem hiding this comment.
Is there a potential conflict here?
If the secret is fetched into the same path as the checkout, and happens before checkout, would the checkout fail? Should we add a check for this? (Seems corner case AND self-inflicted, but still)
| ``name`` (required) | ||
| The name of the secret. | ||
| ``env`` | ||
| The environment variable to export the secret in. |
Contributor
There was a problem hiding this comment.
Does this override anything set in worker.env? Should we mention it here?
| print_line(b"secrets", f"fetched secret {name}\n".encode()) | ||
| value = value if isinstance(value, str) else json.dumps(value) | ||
| if path is not None: | ||
| _write_secret_file(path, value) |
Contributor
There was a problem hiding this comment.
if for some reason the write fails half way thru, this will be a problem.
We should attempt to delete the file on any write failures.
| Use Secrets | ||
| =========== | ||
|
|
||
| Tasks often need secrets such as an API tokens or private keys. Taskgraph can |
Contributor
There was a problem hiding this comment.
nit: either "..such as API tokens.." or "..such as an API token or private key."
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.