-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
32 lines (32 loc) · 966 Bytes
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: 'pnpm-filter'
description: 'Github Action to determine if app source code has changed in a pnpm monorepo.'
branding:
icon: 'filter'
color: 'green'
inputs:
PAT:
description: "Repository PAT to authenticate checkout"
required: true
outputs:
changedProjects:
description: "Changed Projects"
value: ${{ steps.pnpm-filter.outputs.changedProjects }}
runs:
using: "composite"
steps:
- uses: pnpm/action-setup@v2
with:
version: 8
- uses: actions/checkout@v3
with:
fetch-depth: 2
token: ${{ inputs.PAT }}
- id: pnpm-filter
shell: bash
run: |
changedPaths=$(pnpm --filter ...[${{ github.event.pull_request.base.sha }}] exec pwd)
if [[ $changedPaths =~ ^No.* ]]; then changedProjects=""; else
changedProjects=$( sed 's|.*/||' <<< $changedPaths )
fi
printf 'Detected changed project: %s\n' $changedProjects
echo changedProjects=$changedProjects >> "$GITHUB_OUTPUT"