-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
41 lines (38 loc) · 1.03 KB
/
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
33
34
35
36
37
38
39
40
41
name: Turborepo Diff Check
description: Run a diff check against a specific package and its dependencies in turborepo
branding:
icon: git-branch
color: gray-dark
inputs:
package:
required: true
use-last-tag:
default: false
outputs:
changed:
description: "Says whether the package has changed according to its dependencies"
value: ${{ steps.changedStep.outputs.changed }}
runs:
using: composite
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check for changes
id: changedStep
shell: bash
run: |
set +e
if [ "${{ inputs.use-last-tag }}" = "false" ]; then
npx turbo-ignore ${{ inputs.package }}
else
LAST_TAG=$(git describe --tags --abbrev=0)
npx turbo-ignore ${{ inputs.package }} --fallback=tags/$LAST_TAG
fi
exit_code=$?
set -e
if [ $exit_code -eq "1" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
fi