Skip to content

Commit a003c14

Browse files
committed
merged latest changes
2 parents 2443ece + 3acdc78 commit a003c14

File tree

48 files changed

+1778
-891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1778
-891
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,5 @@ jobs:
308308
id: create_release
309309
env:
310310
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
311-
run: gh release create v${{ steps.publish-core.outputs.version }} --title "Release ${{ steps.publish-core.outputs.version }}" --generate-notes
311+
VERSION: ${{ steps.publish-to-npm.outputs.version }}
312+
run: gh release create v"$VERSION" --title "Release $VERSION" --generate-notes

.github/workflows/unit-test.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Run Unit Tests
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
run-tests:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '22.x'
18+
19+
- name: Install dependencies for all plugins
20+
run: |
21+
npm run setup-repo-old
22+
23+
- name: Run tests for Audit plugin
24+
working-directory: ./packages/contentstack-audit
25+
run: npm run test:unit
26+
27+
# - name: Fetch latest references
28+
# run: |
29+
# git fetch --prune
30+
31+
# - name: Identify Changed Plugins
32+
# id: changes
33+
# run: |
34+
# echo "Finding changed files..."
35+
# # Ensure both commit references are valid
36+
# if [[ -z "${{ github.event.before }}" || -z "${{ github.sha }}" ]]; then
37+
# echo "Error: Missing commit references"
38+
# exit 1
39+
# fi
40+
41+
# CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
42+
# echo "Changed files:"
43+
# echo "$CHANGED_FILES"
44+
45+
# # Identify affected plugins
46+
# AFFECTED_PLUGINS=$(echo "$CHANGED_FILES" | grep -oP '(?<=^packages/)([^/]+)' | sort -u | tr '\n' ' ')
47+
# echo "Affected plugins: $AFFECTED_PLUGINS"
48+
49+
# # Set output for the next step
50+
# echo "::set-output name=affected_plugins::$AFFECTED_PLUGINS"
51+
52+
# - name: Run Unit Tests for Affected Plugins
53+
# run: |
54+
# for plugin in ${{ steps.changes.outputs.affected_plugins }}; do
55+
# echo "Checking if tests should run for $plugin..."
56+
# if [[ "$plugin" == "contentstack-audit" ]]; then
57+
# echo "Running tests for contentstack-audit..."
58+
# npm run test:unit --prefix ./packages/contentstack-audit
59+
# else
60+
# echo "contentstack-audit has not changed. Skipping tests."
61+
# fi
62+
# done

0 commit comments

Comments
 (0)