Skip to content
Snippets Groups Projects
Unverified Commit 62bd10d2 authored by Florian Forster's avatar Florian Forster
Browse files

feat(autolabels): Add the "autolabels" job.

Issue: gitlab-com/gl-infra/common-ci-tasks#34
parent 3da5ae09
No related branches found
No related tags found
No related merge requests found
Pipeline #24768546 passed
spec:
inputs:
stage:
default: "build"
version:
default: "v${GL_AUTOLABELS_VERSION}"
vault:
default: ""
---
# Include exactly one of the following files:
include:
# Option 1: Vault with explicit path from the "vault" input
- local: 'internal/autolabels/vault.yml'
rules:
- if: '"$[[ inputs.vault | expand_vars ]]" != ""'
inputs:
vault: "$[[ inputs.vault | expand_vars ]]"
# Option 2: Variable using AUTOLABELS_TOKEN (compatibility behavior)
- local: 'internal/autolabels/variable.yml'
rules:
- if: '"$[[ inputs.vault | expand_vars ]]" == "" && $AUTOLABELS_TOKEN != null'
# Option 3 (default): Vault using a well-known default path
- local: 'internal/autolabels/vault.yml'
rules:
- if: '"$[[ inputs.vault | expand_vars ]]" == "" && $AUTOLABELS_TOKEN == null'
inputs:
vault: "access_tokens/${VAULT_SECRETS_PATH}/autolabels/token@ci"
# Include the "autolabels 🏷️" job from the autolabels repository.
- project: 'gitlab-com/gl-infra/autolabels'
ref: v1.2.3 # renovate:managed
file: 'ci-tasks/autolabels.yml'
inputs:
stage: $[[ inputs.stage ]]
# Amend the "extends" field to the "autolabels 🏷️" job.
autolabels 🏷️:
extends: .autolabels_auth # Vault or CI variable, from internal/autolabels/{vault,variable}.yml
# DO NOT INCLUDE DIRECTLY!
---
.autolabels_auth:
variables:
AUTOLABELS_AUTH_SOURCE: "CI/CD Variables"
# DO NOT INCLUDE DIRECTLY!
spec:
inputs:
vault:
---
.autolabels_auth:
id_tokens:
VAULT_ID_TOKEN:
aud: https://vault.gitlab.net
variables:
AUTOLABELS_AUTH_SOURCE: "Vault"
secrets:
AUTOLABELS_TOKEN:
file: false
vault: $[[ inputs.vault ]]
token: $VAULT_ID_TOKEN
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment