New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@codefresh-io/pipeline-autobot

Package Overview
Dependencies
Maintainers
11
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codefresh-io/pipeline-autobot

Generate yaml depend on repo context

  • 1.7.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
11
Created
Source

Repository analyzer

About

Component for analyze github repository use github statistic API and generate codefresh steps according repo info.

Content
  • Usage
  • Component description

Usage

Examples how use repo analyzer

Run analyzer without cf integration

Run test.js with envs

PASSWORD=****2
REPO_OWNER=codefresh-io
REPO_NAME=pipeline-manager
GIT_CONTEXT=github

Run analyzer using CLI

https://codefresh-io.github.io/cli/analyzer/

Example of analyzer flow

    analyzer
        .step(clone)
        .step(build)
        .step(push)
        .step(packageJson)
        .header(stages)
        .enrich(stagesEnricher)
        .transform(codefreshYaml)
        .resolve()

Handler types that analyzer support

  1. Transformers - ability to transform from some info to whole yaml file , use cases :

    • Check that repo contain codefresh.yaml (source github context -> output codefresh yaml path)
    • Convert from gitlab to codefresh yaml (source github context -> output codefresh yaml with steps) Important : after transformer execution if we have result we terminate whole chain (not make any sense to continue)
  2. Headers - ability to add some yaml parts before steps key use cases:

    • Add codefresh yaml stages
    • Add yaml version
  3. Steps - ability to add some step to generated pipeline, like git clone, build, notifications, etc

  4. Enricher - ability to enrich each step some additional information, like stage for each step

Adding new handler

For add new handler you should create .js in related folder (like analyzer.steps)

Each step has as input analyzer.context (you can access from it githup api, credentials, everything that you need)

module.exports = (context) => {
   
       const { repo: { repoOwner, repoName, branch } , git } = context.getContext();
   
       return {
           step : {
               type: 'git-clone',
               description: 'Cloning main repository...',
               repo: `${repoOwner}/${repoName}`,
               revision: branch,
               git
           },
           key: 'clone',
           group: 'clone'
       };
   };

Where
key - it is step name
group - logical group, like test, linters, etc, will be helpful in future . (For now using it for stages)

FAQs

Package last updated on 02 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc