Cross-Provider Workflow

GitLab CI Job Failure to GitHub Issue to Slack

Version 1.0.0

Find a failed GitLab CI job, open a GitHub issue, then notify Slack.

1 workflow 3 source APIs 3 providers
View Spec View on GitHub ArazzoWorkflowsCross-Provider

Providers Orchestrated

gitlab github slack

Workflows

ci-failure-to-issue-to-slack
Find a failed GitLab job, open a GitHub issue, and notify Slack.
Lists jobs for a GitLab project to find a failed CI job, opens a GitHub issue to track the build break, and posts a Slack message with the link.
3 steps inputs: owner, projectId, repo, slackChannel outputs: issueNumber, issueUrl, jobId, messageTs
1
list-jobs
$sourceDescriptions.gitlabProjects.listProjectJobs
List jobs for the GitLab project to find a failed CI job.
2
open-issue
$sourceDescriptions.githubIssues.createAnIssue
Open a GitHub issue to track the failed CI job.
3
notify-slack
$sourceDescriptions.slackChat.postChatPostmessage
Notify a Slack channel about the failed pipeline job.

Source API Descriptions

Arazzo Workflow Specification

dev-gitlab-ci-failure-to-github-issue-slack.yml Raw ↑
arazzo: 1.0.1
info:
  title: GitLab CI Job Failure to GitHub Issue to Slack
  summary: Find a failed GitLab CI job, open a GitHub issue, then notify Slack.
  description: >-
    A CI failure-response workflow that lists jobs for a GitLab project to find a
    failed pipeline job, opens a GitHub issue to track the build break, and
    notifies a Slack channel so the team can fix the pipeline. Demonstrates
    chaining a CI provider, a source-control provider, and a chat provider in a
    single Arazzo workflow.
  version: 1.0.0
sourceDescriptions:
  - name: gitlabProjects
    url: https://raw.githubusercontent.com/api-evangelist/gitlab/refs/heads/main/openapi/gitlab-api-v4-projects-openapi-original.yml
    type: openapi
  - name: githubIssues
    url: https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/openapi/github-repo-issues-api-openapi.yml
    type: openapi
  - name: slackChat
    url: https://raw.githubusercontent.com/api-evangelist/slack/refs/heads/main/openapi/slack-chat-openapi.yml
    type: openapi
workflows:
  - workflowId: ci-failure-to-issue-to-slack
    summary: Find a failed GitLab job, open a GitHub issue, and notify Slack.
    description: >-
      Lists jobs for a GitLab project to find a failed CI job, opens a GitHub
      issue to track the build break, and posts a Slack message with the link.
    inputs:
      type: object
      properties:
        projectId:
          type: integer
        owner:
          type: string
        repo:
          type: string
        slackChannel:
          type: string
    steps:
      - stepId: list-jobs
        description: List jobs for the GitLab project to find a failed CI job.
        operationId: $sourceDescriptions.gitlabProjects.listProjectJobs
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          jobId: $response.body#/0/id
          jobName: $response.body#/0/name
          jobWebUrl: $response.body#/0/web_url
      - stepId: open-issue
        description: Open a GitHub issue to track the failed CI job.
        operationId: $sourceDescriptions.githubIssues.createAnIssue
        requestBody:
          contentType: application/json
          payload:
            title: $steps.list-jobs.outputs.jobName
            body: $steps.list-jobs.outputs.jobWebUrl
            labels:
              - ci
              - gitlab
        successCriteria:
          - condition: $statusCode == 201
        outputs:
          issueNumber: $response.body#/number
          issueUrl: $response.body#/html_url
      - stepId: notify-slack
        description: Notify a Slack channel about the failed pipeline job.
        operationId: $sourceDescriptions.slackChat.postChatPostmessage
        requestBody:
          contentType: application/json
          payload:
            channel: $inputs.slackChannel
            text: $steps.open-issue.outputs.issueUrl
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          messageTs: $response.body#/ts
    outputs:
      jobId: $steps.list-jobs.outputs.jobId
      issueNumber: $steps.open-issue.outputs.issueNumber
      issueUrl: $steps.open-issue.outputs.issueUrl
      messageTs: $steps.notify-slack.outputs.messageTs