GitLab · Arazzo Workflow

GitLab Retire an Instance-Level CI Variable

Version 1.0.0

Confirm an instance CI variable exists, then delete it.

1 workflow 1 source API 1 provider
View Spec View on GitHub CodePlatformSoftware DevelopmentSource ControlArazzoWorkflows

Provider

gitlab

Workflows

retire-instance-ci-variable
Delete an instance-level CI/CD variable after confirming it exists.
Reads the instance variable by key; on 200 it deletes the variable, and on 404 it ends because there is nothing to retire.
2 steps inputs: key, privateToken outputs: deletedKey
1
getVariable
getApiV4AdminCiVariablesKey
Read the instance variable by key to confirm it exists before deleting.
2
deleteVariable
deleteApiV4AdminCiVariablesKey
Delete the confirmed instance-level variable.

Source API Descriptions

Arazzo Workflow Specification

gitlab-retire-instance-ci-variable-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: GitLab Retire an Instance-Level CI Variable
  summary: Confirm an instance CI variable exists, then delete it.
  description: >-
    An admin CI cleanup flow. The workflow reads an instance-level CI/CD variable
    by key to confirm it exists, branches on the result, and deletes it when
    present. When the variable is already absent the flow ends without action.
    Every step spells out its request inline so the flow can be read and executed
    without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: gitlabAdminApi
  url: ../openapi/gitlab-openapi-original.yml
  type: openapi
workflows:
- workflowId: retire-instance-ci-variable
  summary: Delete an instance-level CI/CD variable after confirming it exists.
  description: >-
    Reads the instance variable by key; on 200 it deletes the variable, and on
    404 it ends because there is nothing to retire.
  inputs:
    type: object
    required:
    - privateToken
    - key
    properties:
      privateToken:
        type: string
        description: GitLab Private-Token used to authenticate the API calls.
      key:
        type: string
        description: The key of the instance-level variable to retire.
  steps:
  - stepId: getVariable
    description: >-
      Read the instance variable by key to confirm it exists before deleting.
    operationId: getApiV4AdminCiVariablesKey
    parameters:
    - name: Private-Token
      in: header
      value: $inputs.privateToken
    - name: key
      in: path
      value: $inputs.key
    successCriteria:
    - condition: $statusCode == 200 || $statusCode == 404
    outputs:
      currentValue: $response.body#/value
    onSuccess:
    - name: exists
      type: goto
      stepId: deleteVariable
      criteria:
      - condition: $statusCode == 200
    - name: absent
      type: end
      criteria:
      - condition: $statusCode == 404
  - stepId: deleteVariable
    description: Delete the confirmed instance-level variable.
    operationId: deleteApiV4AdminCiVariablesKey
    parameters:
    - name: Private-Token
      in: header
      value: $inputs.privateToken
    - name: key
      in: path
      value: $inputs.key
    successCriteria:
    - condition: $statusCode == 204
    outputs:
      deletedKey: $response.body#/key
  outputs:
    deletedKey: $steps.deleteVariable.outputs.deletedKey