Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mapado/install-deps-from-pr

Package Overview
Dependencies
Maintainers
5
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mapado/install-deps-from-pr

Install dependencies from PR description

  • 2.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-88.89%
Maintainers
5
Weekly downloads
 
Created
Source

install-deps-from-pr

Install dependencies according to PR description

Installation

Create the following file in your root package repository install-deps-from-pr.config.js (or install-deps-from-pr.config.mjs if your package is not a module), with the following default export:

const config = {
  currentRepo: 'owner/repo-name', // the current repository name

  // A regex or an array of regex that matches a block in your github description
  prDescriptionRegex: [
    /### Dependencies([\s\S]*?)\n#/,
    /### Dependencies([\s\S]*?)$/,
  ],

  // an array of valid repositories that will be searched for this PR
  repos: ['owner/cart', 'owner/tools'],
};

export default config;

Using typescript ?

You can use a typescript configuration file named install-deps-from-pr.config.ts

import { Config } from '@mapado/install-deps-from-pr';

const config: Config = {
  // your configuration
};

export default config;

Usage

This script needs two environment variables:

  • GITHUB_ACCESS_TOKEN
  • BRANCH_NAME

Then execute the following script:

npx -y @mapado/install-deps-from-pr

It will create a install-deps-from-pr directory and install thoses dependencies in it.

Then it will launch the following commands:

  • yarn install
  • yarn build

And copy the folder into the node_modules directory

Troubleshooting

You may encounter an issue with an infinite build with npx never finishing.

If you have this issue, you might want to install the package in your dev dependencies:

# install one time
yarn add --dev @mapado/install-deps-from-pr

# execute
yarn install-deps-from-pr

FAQs

Package last updated on 19 Jan 2024

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