Skip to content

Commit 861d92b

Browse files
committed
Updated path github action runs on
1 parent 038aa56 commit 861d92b

2 files changed

Lines changed: 19 additions & 3 deletions

File tree

.github/workflows/breaking-changes.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,25 @@ jobs:
2727
- name: Install dependencies
2828
run: bun install --frozen-lockfile
2929

30+
# cre-sdk's buf.yaml points at ../../submodules/chainlink-protos/cre, which buf rejects when
31+
# --against uses subdir=packages/cre-sdk (module path escapes the context). Run breaking on
32+
# the chainlink-protos workspace instead, comparing HEAD to the submodule commit pinned on main.
3033
- name: Buf breaking (proto)
31-
working-directory: packages/cre-sdk
32-
run: bun x @bufbuild/buf breaking . --against '.git#branch=main,subdir=packages/cre-sdk' --error-format github-actions
34+
run: |
35+
set -euo pipefail
36+
REPO="${{ github.workspace }}"
37+
SUBMODULE="${REPO}/submodules/chainlink-protos"
38+
BASE_COMMIT=$(git -C "$REPO" rev-parse origin/main:submodules/chainlink-protos)
39+
BASE_DIR="${RUNNER_TEMP}/chainlink-protos-baseline"
40+
if ! git -C "$SUBMODULE" cat-file -e "${BASE_COMMIT}^{commit}" 2>/dev/null; then
41+
git -C "$SUBMODULE" fetch --no-tags origin "${BASE_COMMIT}"
42+
fi
43+
git -C "$SUBMODULE" worktree add "${BASE_DIR}" "${BASE_COMMIT}" --detach
44+
cleanup() {
45+
git -C "$SUBMODULE" worktree remove "${BASE_DIR}" --force || true
46+
}
47+
trap cleanup EXIT
48+
(cd "$SUBMODULE" && bun x @bufbuild/buf breaking cre --against "${BASE_DIR}/cre" --error-format github-actions)
3349
3450
ts-api-surface:
3551
runs-on: ubuntu-latest

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ If your change is intentional, update the relevant baseline before pushing:
273273

274274
| Contract | What triggers the failure | How to update |
275275
|---|---|---|
276-
| Proto fields | Field deleted, renamed, renumbered, or type changed | No baseline file needed — `buf breaking` passes once protos are correct |
276+
| Proto fields | Field deleted, renamed, renumbered, or type changed | No baseline file needed — CI runs `buf breaking` on `submodules/chainlink-protos` (`cre` module) against the submodule commit pinned on `main` |
277277
| TypeScript public API | An exported type/interface was removed or changed | Run `bun run update-api-baseline` inside `packages/cre-sdk` and commit `api-baseline.d.ts` |
278278
| JS host binding names | A binding was added, removed, or renamed in `host-bindings.ts` | Run `bun test --update-snapshots` inside `packages/cre-sdk` and commit the updated `__snapshots__` file |
279279
| Rust host imports | An `extern "C"` import was added or removed in `lib.rs` | Re-run the sed extraction (see `breaking-changes.yml`) and commit `host-imports-baseline.txt` |

0 commit comments

Comments
 (0)