Skip to content

Commit 59ec98c

Browse files
committed
fix: use yarn link as fallback instead of file link
Replace file:.. fallback with yarn link which is more reliable. Yarn link creates proper symlinks that Strapi can recognize, whereas file:.. may not install correctly in all scenarios. Workflow: 1. Try yalc (might fail on Node 20+) 2. If yalc fails, use yarn link as fallback 3. Install playground deps (plugin now available via link)
1 parent a007ece commit 59ec98c

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.github/workflows/tests.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,23 @@ jobs:
3636
cache: 'yarn'
3737
- name: Install dependencies plugin
3838
run: yarn --no-lockfile --unsafe-perm
39-
- name: Push the package to yalc
39+
- name: Build plugin
4040
run: yarn build
41-
- name: Add yalc package to the playground
42-
run: yarn playground:yalc-add
43-
- name: Ensure plugin is available (fallback if yalc failed)
41+
- name: Link plugin to playground
4442
run: |
45-
cd playground
46-
if [ ! -d ".yalc/strapi-plugin-config-sync" ]; then
47-
echo "Yalc link failed, using file link as fallback"
48-
sed -i 's|"strapi-plugin-config-sync": "link:.yalc/strapi-plugin-config-sync"|"strapi-plugin-config-sync": "file:.."|' package.json
49-
# Remove lock and cache to ensure fresh install
50-
rm -f yarn.lock
51-
rm -rf node_modules/strapi-plugin-config-sync
43+
# Try yalc first
44+
yarn playground:yalc-add || true
45+
46+
# Check if yalc succeeded
47+
if [ ! -d "playground/.yalc/strapi-plugin-config-sync" ]; then
48+
echo "Yalc failed, using yarn link as fallback"
49+
# Use yarn link instead
50+
yarn link
51+
cd playground
52+
yarn link strapi-plugin-config-sync
5253
fi
5354
- name: Install dependencies playground
54-
run: cd playground && yarn install --unsafe-perm --force
55+
run: cd playground && yarn install --unsafe-perm
5556
- name: Build playground
5657
run: yarn playground:build
5758
# - name: Run unit tests

0 commit comments

Comments
 (0)