arazzo: 1.0.1
info:
title: GitLab Add and Preview a Project Badge
summary: Render a badge preview, then add it to a project and confirm the list.
description: >-
A project badge provisioning flow. The workflow first renders a preview of
the badge link and image, adds the badge to the project, and then lists the
project 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
x-realizes-capability-ids:
- BC-4200.40
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-4200.40
capability_name: Software Construction Management
spec: gitlab-projects-api-openapi.yml
confidence: 0.8
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: projectsApi
url: ../openapi/gitlab-projects-api-openapi.yml
type: openapi
workflows:
- workflowId: add-project-badge
summary: Preview, add, and confirm a project badge.
description: >-
Previews the badge render, creates the badge on the project, then lists
project badges to verify it exists.
inputs:
type: object
required:
- privateToken
- projectId
- linkUrl
- imageUrl
properties:
privateToken:
type: string
description: GitLab Private-Token used to authenticate the API calls.
projectId:
type: string
description: The ID or URL-encoded path of the project.
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: pipeline
steps:
- stepId: previewBadge
description: Render a preview of the badge link and image before persisting it.
operationId: getApiV4ProjectsIdBadgesRender
parameters:
- name: Private-Token
in: header
value: $inputs.privateToken
- name: id
in: path
value: $inputs.projectId
- 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 project.
operationId: postApiV4ProjectsIdBadges
parameters:
- name: Private-Token
in: header
value: $inputs.privateToken
- name: id
in: path
value: $inputs.projectId
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 project badges to confirm the new badge is present.
operationId: getApiV4ProjectsIdBadges
parameters:
- name: Private-Token
in: header
value: $inputs.privateToken
- name: id
in: path
value: $inputs.projectId
- 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
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.