This repository has been archived, development will continue on https://github.com/aquasecurity/pipeline-parser
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.
| Platform |
|---|
| GitHub Workflows |
| GitLab CI |
| Azure Pipelines |
| Bitbucket Pipelines |
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)| 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) |
pipeline-parser -p github workflow.ymlpipeline-parser -p gitlab .gitlab-ci.ymlpipeline-parser -p azure .azure-pipelines.ymlpipeline-parser -p bitbucket .bitbucket-pipelines.ymlpipeline-parser -p github workflow-1.yml workflow-2.yml workflow-3.ymlFirst, execute the following command to enable the client's git hooks:
git config core.hooksPath .githooks