GitLab · Arazzo Workflow

GitLab Add and Preview a Group Badge

Version 1.0.0

Render a group badge preview, add it to the group, and confirm the list.

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

Provider

gitlab

Workflows

add-group-badge
Preview, add, and confirm a group badge.
Previews the badge render, creates the badge on the group, then lists group badges to verify it exists.
3 steps inputs: groupId, imageUrl, linkUrl, name, privateToken outputs: badgeId, badgeName
1
previewBadge
getApiV4GroupsIdBadgesRender
Render a preview of the group badge before persisting it.
2
addBadge
postApiV4GroupsIdBadges
Add the badge to the group.
3
confirmBadges
getApiV4GroupsIdBadges
List the group badges to confirm the new badge is present.

Source API Descriptions

Arazzo Workflow Specification

gitlab-add-group-badge-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: GitLab Add and Preview a Group Badge
  summary: Render a group badge preview, add it to the group, and confirm the list.
  description: >-
    A group badge provisioning flow. The workflow renders a preview of the badge
    link and image, adds the badge to the group so every project in the group
    inherits it, and then lists the group badges to confirm it was persisted.
    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: gitlabGroupsApi
  url: ../openapi/gitlab-api-v4-groups-openapi-original.yml
  type: openapi
workflows:
- workflowId: add-group-badge
  summary: Preview, add, and confirm a group badge.
  description: >-
    Previews the badge render, creates the badge on the group, then lists group
    badges to verify it exists.
  inputs:
    type: object
    required:
    - privateToken
    - groupId
    - linkUrl
    - imageUrl
    properties:
      privateToken:
        type: string
        description: GitLab Private-Token used to authenticate the API calls.
      groupId:
        type: string
        description: The ID or URL-encoded path of the group.
      linkUrl:
        type: string
        description: URL of the badge link.
      imageUrl:
        type: string
        description: URL of the badge image.
      name:
        type: string
        description: Name for the badge.
        default: coverage
  steps:
  - stepId: previewBadge
    description: Render a preview of the group badge before persisting it.
    operationId: getApiV4GroupsIdBadgesRender
    parameters:
    - name: Private-Token
      in: header
      value: $inputs.privateToken
    - name: id
      in: path
      value: $inputs.groupId
    - name: link_url
      in: query
      value: $inputs.linkUrl
    - name: image_url
      in: query
      value: $inputs.imageUrl
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      renderedImageUrl: $response.body#/rendered_image_url
  - stepId: addBadge
    description: Add the badge to the group.
    operationId: postApiV4GroupsIdBadges
    parameters:
    - name: Private-Token
      in: header
      value: $inputs.privateToken
    - name: id
      in: path
      value: $inputs.groupId
    requestBody:
      contentType: application/json
      payload:
        link_url: $inputs.linkUrl
        image_url: $inputs.imageUrl
        name: $inputs.name
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      badgeId: $response.body#/id
      badgeName: $response.body#/name
  - stepId: confirmBadges
    description: List the group badges to confirm the new badge is present.
    operationId: getApiV4GroupsIdBadges
    parameters:
    - name: Private-Token
      in: header
      value: $inputs.privateToken
    - name: id
      in: path
      value: $inputs.groupId
    - name: name
      in: query
      value: $inputs.name
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      firstBadgeId: $response.body#/0/id
  outputs:
    badgeId: $steps.addBadge.outputs.badgeId
    badgeName: $steps.addBadge.outputs.badgeName