
Gitlab Ci Variables Secrets
- 1 installs
- 186 repo stars
- Updated July 19, 2026
- thebushidocollective/han
Configure GitLab CI/CD variables, manage secrets, and integrate with external secret providers for secure credential handling.
About
Covers GitLab CI/CD variables, secret management, and integration with external secret providers. A developer uses it when handling credentials securely in a GitLab pipeline.
- CI/CD variables and secret management
- Integration with external secret providers
Gitlab Ci Variables Secrets by the numbers
- 1 all-time installs (skills.sh)
- Ranked #1,173 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
- Data as of Aug 1, 2026 (Skillselion catalog sync)
npx skills add https://github.com/thebushidocollective/han --skill gitlab-ci-variables-secretsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 186 |
| Last updated | July 19, 2026 |
| Repository | thebushidocollective/han ↗ |
What it does
Configure GitLab CI/CD variables, manage secrets, and integrate with external secret providers for secure credential handling.
Files
GitLab CI - Variables & Secrets
Configure CI/CD variables and manage secrets securely in GitLab pipelines.
Variable Types
Predefined Variables
build:
script:
- echo "Branch: $CI_COMMIT_BRANCH"
- echo "Commit: $CI_COMMIT_SHA"
- echo "Pipeline: $CI_PIPELINE_ID"
- echo "Project: $CI_PROJECT_NAME"
- echo "Registry: $CI_REGISTRY_IMAGE"Custom Variables
variables:
NODE_ENV: production
DATABASE_URL: "postgres://localhost/app"
build:
variables:
BUILD_TARGET: dist
script:
- npm run build --target=$BUILD_TARGETVariable Scopes
Global Variables
variables:
GLOBAL_VAR: "available everywhere"Job-Level Variables
deploy:
variables:
DEPLOY_ENV: production
script:
- ./deploy.sh $DEPLOY_ENVEnvironment-Scoped Variables
Configure in GitLab UI: Settings > CI/CD > Variables
- Scope to specific environments (production, staging)
- Scope to specific branches (main, develop)
Protected and Masked Variables
In gitlab-ci.yml
variables:
PUBLIC_KEY:
value: "pk_test_xxx"
description: "Stripe public key"In GitLab UI
Set variables with:
- Protected: Only available on protected branches/tags
- Masked: Hidden in job logs (requires specific format)
- Expanded: Allow variable references within value
File-Type Variables
deploy:
script:
- cat $KUBECONFIG # File variable contents
- kubectl apply -f deployment.yamlExternal Secret Providers
HashiCorp Vault
job:
secrets:
DATABASE_PASSWORD:
vault:
engine:
name: kv-v2
path: secret
field: password
path: production/dbAzure Key Vault
job:
secrets:
API_KEY:
azure_key_vault:
name: my-api-key
version: latestAWS Secrets Manager
job:
secrets:
AWS_SECRET:
aws_secrets_manager:
name: prod/api-key
version_id: latestOIDC Authentication
deploy:aws:
id_tokens:
AWS_TOKEN:
aud: https://gitlab.com
script:
- >
aws sts assume-role-with-web-identity
--role-arn $AWS_ROLE_ARN
--web-identity-token $AWS_TOKENBest Practices
1. Never hardcode secrets in .gitlab-ci.yml 2. Use protected variables for production credentials 3. Mask sensitive values to prevent log exposure 4. Prefer OIDC over long-lived credentials 5. Scope variables to minimum required environments 6. Use file-type variables for certificates and keys