Per Repository

Updated 2 years ago by Admin

Repository secrets are used to store and manage sensitive information, such as passwords, tokens, and ssh keys. Storing this information in a secret is considered safer than storing it in your configuration file in plain text.

Push access or administrator access is required to create, update or delete repository secrets.

Manage repository secrets from the repository settings screen:

Source environment variables from named secrets:

1  kind: pipeline
2 name: default
3
4 steps:
5 - name: build
6 image: alpine
7 environment:
8 USERNAME:
9 from_secret: docker_username
10 PASSWORD:
11 from_secret: docker_password

Source plugin settings from named secrets:

1  kind: pipeline
2 name: default
3
4 steps:
5 - name: build
6 image: plugins/docker
7 settings:
8 repo: octocat/hello-world
9 username:
10 from_secret: docker_username
11 password:
12 from_secret: docker_password

Pull Requests

Secrets are not exposed to pull requests by default. This prevents a bad actor from sending a pull request and attempting to expose your secrets. You can override this default behavior, at your own risk, by checking Allow Pull Requests when you create your secret.


How did we do?