Skip to content

Commit 4cb0722

Browse files
committed
add yarn lock verification in flowise-embed-react stage
1 parent 79b923c commit 4cb0722

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

.github/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ workflow_dispatch (bump, tag, optional: custom_version / recovery_version)
2222
poll npm registry until new version is available
2323
|
2424
v
25-
flowise-embed-react: update dep + version → install → build → npm publish --tag <tag> → create version bump PR
25+
flowise-embed-react: update dep + version → yarn upgrade → install → verify lock file → build → npm publish --tag <tag> → restore dep tag to latest → create version bump PR
2626
```
2727

2828
## Usage
@@ -133,7 +133,9 @@ Both packages are published with the same dist-tag. Use `latest` for stable rele
133133

134134
### Dependency update in FlowiseEmbedReact
135135

136-
The workflow sets `devDependencies.flowise-embed` to the exact new version using `npm pkg set`. This changes the specifier (e.g. from `"latest"` to `"3.1.4"`), which forces yarn to re-resolve from the registry and update `yarn.lock`. Both `package.json` and `yarn.lock` are included in the version bump PR.
136+
The workflow pins `devDependencies.flowise-embed` to the exact new version using `npm pkg set`, then runs `yarn upgrade flowise-embed@<version>` to explicitly force yarn to resolve and lock that version — this is more reliable than relying on `yarn install` alone to detect the `package.json` change. A verification step then greps `yarn.lock` to confirm the correct version was resolved, failing the build if not.
137+
138+
After publishing, the workflow restores the dependency specifier back to `"latest"` before creating the version bump PR. This means the PR commits `package.json` with `"flowise-embed": "latest"` and `yarn.lock` with the resolved version pinned.
137139

138140
### npm registry propagation
139141

.github/workflows/publish.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,29 @@ jobs:
331331
run: |
332332
npm pkg set "version=${NEW_VERSION}"
333333
npm pkg set "devDependencies.flowise-embed=${NEW_VERSION}"
334+
yarn upgrade flowise-embed@${NEW_VERSION}
334335
335336
- name: Install flowise-embed-react dependencies
336337
working-directory: flowise-embed-react
337-
run: yarn install
338338
env:
339+
NEW_VERSION: ${{ needs.dry-run.outputs.version }}
339340
HUSKY: '0'
341+
run: |
342+
yarn install
343+
344+
- name: Verify flowise-embed version in lock file
345+
working-directory: flowise-embed-react
346+
env:
347+
NEW_VERSION: ${{ needs.dry-run.outputs.version }}
348+
run: |
349+
if ! grep -q "flowise-embed@${NEW_VERSION}" yarn.lock 2>/dev/null && \
350+
! grep -A1 '"flowise-embed"' yarn.lock | grep -q "${NEW_VERSION}"; then
351+
echo "::error::yarn.lock does not contain flowise-embed@${NEW_VERSION}"
352+
echo "Lock file flowise-embed entries:"
353+
grep -A5 "flowise-embed" yarn.lock || true
354+
exit 1
355+
fi
356+
echo "Verified: flowise-embed@${NEW_VERSION} resolved in yarn.lock"
340357
341358
- name: Build flowise-embed-react
342359
working-directory: flowise-embed-react
@@ -350,6 +367,10 @@ jobs:
350367
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
351368
TAG: ${{ inputs.tag }}
352369

370+
- name: Restore flowise-embed dependency tag to latest
371+
working-directory: flowise-embed-react
372+
run: npm pkg set "devDependencies.flowise-embed=latest"
373+
353374
- name: Create flowise-embed-react version bump PR
354375
working-directory: flowise-embed-react
355376
env:

0 commit comments

Comments
 (0)