Skip to content
This repository was archived by the owner on Sep 7, 2025. It is now read-only.

argonsecurity/pipeline-parser

Repository files navigation

Archived

This repository has been archived, development will continue on https://github.com/aquasecurity/pipeline-parser

Pipeline Parser

Test Pipeline Parser License go-report-card coverage report

Description

Pipeline Parser is Argon's solution for parsing and analyzing pipeline files of popular CI yaml files in order to create a generic pipeline entity that can be used across platforms.

Supported Platforms:

Platform
GitHub Workflows
GitLab CI
Azure Pipelines
Bitbucket Pipelines

Usage

Package Usage

import (
    "os"

    "github.com/argonsecurity/pipeline-parser/pkg/handler"
    "github.com/argonsecurity/pipeline-parser/pkg/consts"
)

// Read the pipeline data as bytes array
buf, err := os.ReadFile("/path/to/workflow.yml")
if err != nil {
    return nil
}

// Parse the pipeline from the specific platform to the common pipeline object
pipeline, err := handler.Handle(buf, consts.GitHubPlatform, scmCredentials, organization, baseProviderUrl)

CLI Usage

CLI flags

Flag Value Description Default
platform (-p) string CI platform to parse github
output (-o) string Output target stdout
file-suffix string File suffix for output file. This flag is useless if 'output' flag is not set to 'file' parsed
token string SCM token to use for fetching remote files if necessary
organization string The target organization when fetching remote files (used for Azure Pipelines)
baseProviderUrl string base api url for the pipeline provider (used for parsing remote templates)

Parse GitHub Workflow yaml

pipeline-parser -p github workflow.yml

Parse GitLab CI yaml

pipeline-parser -p gitlab .gitlab-ci.yml

Parse Azure Pipelines yaml

pipeline-parser -p azure .azure-pipelines.yml

Parse Bitbucket Pipelines yaml

pipeline-parser -p bitbucket .bitbucket-pipelines.yml

Parse multiple files in one execution

pipeline-parser -p github workflow-1.yml workflow-2.yml workflow-3.yml

Local Development

First, execute the following command to enable the client's git hooks:

git config core.hooksPath .githooks

About

No description or website provided.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 8

Languages