Skip to content
check

GitHub Action

Action Rush Version Policy Command

v1.0.1 Latest version

Action Rush Version Policy Command

check

Action Rush Version Policy Command

Based on a version policy, build the changed modules and publish to artifactory based on module configuration

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Action Rush Version Policy Command

uses: advancedcsg-open/[email protected]

Learn more about this action in advancedcsg-open/actions-rush-cmd-to-version-policy

Choose a version

Action Rush Version Policy Command

JavaScript Style Guide Commitizen friendly action status

This actions will execute a single cli command for each rush project that has a matching version policy as specified in the action parameters.

This was created to fill a specific gap we found in the way Rush is executed. Due to the way our apps build we need the shared modules in the monorepo to publish to NPM before we can build the app.

Using version policy to isolate groups of packages is an efficient way to do this until rush supports this natively (via tagging).

Usage

Pre-requisites


This action requires rush version 5.47.0 or newer. You will need to have run rush install on the monorepo before running this action. You can use RushJS Helper to do that.

Inputs


version-policy

Required. The version policy to target when executing the command.

cmd

Required. The command to execute, for example npm or yarn. The command will be executed from the root folder of the project, not the root of the repository.

cmd-args

Optional. Command arguments, for example run,publish-rt. Note, arguments MUST be comma separated.

Examples


Example 1

The below example runs pnpm publish on all projects that have a matching version policy.

name: Rush Install

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2

      - name: Setup Node.js
        uses: actions/[email protected]
        with:
          node-version: '12.x'

      - name: Rush Install
        uses: advancedcsg-open/actions-rush
        with:
          build: true

      - name: Rush build and publish `modules`
        uses: ./
        with:
          version-policy: modules
          cmd: pnpm
          cmd-args: publish

      - name: Rush build and publish `apps`
        uses: ./
        with:
          version-policy: apps
          cmd: pnpm
          cmd-args: publish

License

actions-rush-cmd-to-version-policy is licensed under the MIT License. See the LICENSE file for more info.