Skip to content

Github action to detect if there are any changes in pnpm workspace or repository using pnpm since some point (git ref, git tag or commit-sha) in your git history

License

Notifications You must be signed in to change notification settings

akshay5995/cambios

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

cambios

Github action to detect if there are any changes in pnpm workspace or repository using pnpm since some point (git ref, git tag or commit-sha) in your git history

Internally uses pnpm's filtering capabilities

Usage

 ....
    steps:
     # setup your node and pnpm
     ....
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Get changed packages
        uses: akshay5995/[email protected]
        id: changed-package-action
        with:
          package-name: "" # Optional
          since: "" # Optional defaults to "origin/main"
      - name: echo changed packages
        run: echo ${{ steps.changed-package-action.outputs.changed-packages }}
      - name: echo CHANGE_DETECTED env
        run: echo ${{ env.CHANGE_DETECTED }}

Inputs

Name in your package.json for the package that you want to detect change for:

    package-name: "" # Optional
    since: "" # Optional defaults to "origin/main"

Outputs

Environment variable:

    CHANGE_DETECTED

Can be used in following steps:

    steps:
      ....
      - name: Get changed packages
        uses: akshay5995/[email protected]
      - name: Run tests if only package has changed
        if: ${{ env.CHANGE_DETECTED }}
        run: pnpm test:ci

Output:

  changed-packages 

Can be used in following steps: (useful in a monorepo that uses pnpm workspaces)

    steps:
      ....
      - name: Get changed packages
        uses: akshay5995/[email protected]
        id: changed-package-action
      - name: Echo all changed packages in the repo
        run: echo ${{ steps.changed-package-action.outputs.changed-packages }}

Outputs stringified Json array for changed packages e.g, "["cambios"]"

About

Github action to detect if there are any changes in pnpm workspace or repository using pnpm since some point (git ref, git tag or commit-sha) in your git history

Topics

Resources

License

Stars

Watchers

Forks