# This workflow will do a clean install of node dependencies at the root and check that a beachball change file has been committed.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Beachball Check

on:
  pull_request:
    branches:  
      - dev
    paths:
      - 'lib/**/*'
      - '!**.md'

jobs:
  beachball-check:
    runs-on: ubuntu-latest
    env:
      BEACHBALL: 1
    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm ci
    - run: npm run beachball:check

# This workflow will do a clean install of node dependencies at the root and check that a beachball change file has been committed.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Beachball Check

on:
  pull_request:
    branches:  
      - dev

jobs:
  beachball-check:
    runs-on: ubuntu-latest
    env:
      BEACHBALL: 1
    steps:
    - uses: dorny/paths-filter@v2
      id: filter
      with:
        # Will return true if any file is not markdown and any file is in /lib
        filters: |
          containsTrackedChanges: 
            - '!**.md'
          lib:
            - 'lib/**/*'
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm ci

    - name: Run Beachball Check command
      if: ${{ steps.filter.outputs.lib == 'true' && steps.filter.outputs.containsTrackedChanges == 'true' }}
      run: npm run beachball:check

Add path filter to beachball check
Add path filter to beachball check
