File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change 2020 run : |
2121 npm run setup-repo-old
2222
23- - name : Run tests for Audit plugin
24- working-directory : ./packages/contentstack-audit
25- run : npm run test:unit
23+ - name : Identify Changed Plugins
24+ id : changes
25+ run : |
26+ echo "Finding changed files..."
27+ CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
28+ echo "Changed files:"
29+ echo "$CHANGED_FILES"
30+
31+ # Identify affected plugins
32+ AFFECTED_PLUGINS=$(echo "$CHANGED_FILES" | grep -oP '(?<=^packages/)([^/]+)' | sort -u | tr '\n' ' ')
33+ echo "Affected plugins: $AFFECTED_PLUGINS"
34+
35+ # Set output for the next step
36+ echo "::set-output name=affected_plugins::$AFFECTED_PLUGINS"
37+
38+ - name : Run Unit Tests for Affected Plugins
39+ run : |
40+ for plugin in ${{ steps.changes.outputs.affected_plugins }}; do
41+ echo "Running tests for $plugin..."
42+ npm run test:unit --prefix ./packages/$plugin
43+ done
You can’t perform that action at this time.
0 commit comments