Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/require-auth-npm-changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ name: "Require @cipherstash/auth changeset"
# and the npm API does not move: the npm binary is built from that crate, and
# nothing else would release it.
#
# Changes that never ship (tests, examples, devDependencies) are filtered out
# by `check-auth-npm-changeset.mjs --shipped`.
#
# The paths below and the job's `git diff` pathspec are held to the same set
# by scripts/__tests__/check-auth-npm-changeset.test.mjs. There is no `push:`
# trigger: the check compares a pull request with its base.
Expand Down Expand Up @@ -75,12 +78,21 @@ jobs:
exit 0
fi

if ! SHIPPED_CHANGES="$(
git diff --name-only "${BASE_SHA}...HEAD" -- \
# --no-renames: a shipped file moved under __tests__/ must still be
# reported by its deleted source path, or isShipped never sees it.
if ! CHANGED="$(
git diff --name-only --no-renames "${BASE_SHA}...HEAD" -- \
packages/stack-auth/Cargo.toml \
packages/stack-auth/src \
languages/typescript/packages/auth \
languages/typescript/packages/stack-auth-wasm
)"; then
Comment thread
coderabbitai[bot] marked this conversation as resolved.
echo "::error::Failed to determine changed stack-auth paths"
exit 1
fi

if ! SHIPPED_CHANGES="$(
node scripts/check-auth-npm-changeset.mjs --shipped "$BASE_SHA" <<< "$CHANGED"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This BASE_SHA contains github.event.pull_request.base.sha which seems like the HEAD of the base branch, not where the current branch diverged from (merge base). This should be using the merge base since the base can move on and contain other changes?

)"; then
echo "::error::Failed to determine release-relevant stack-auth changes"
exit 1
Expand All @@ -91,6 +103,9 @@ jobs:
exit 0
fi

echo "Release-relevant stack-auth changes:"
echo "$SHIPPED_CHANGES"

if ! CHANGESETS="$(
git diff --diff-filter=AM --name-only "${BASE_SHA}...HEAD" -- '.changeset/*.md'
)"; then
Expand Down
2 changes: 1 addition & 1 deletion languages/typescript/packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@
"devDependencies": {
"@napi-rs/cli": "^2",
"typescript": "^5",
"vitest": "^3"
"vitest": "catalog:repo"
}
}
2 changes: 1 addition & 1 deletion languages/typescript/packages/profile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"devDependencies": {
"@napi-rs/cli": "^2",
"vitest": "^3",
"vitest": "catalog:repo",
"typescript": "^5"
}
}
Loading
Loading