From 378bf76ef367fef4039c09074692684c407db2a3 Mon Sep 17 00:00:00 2001 From: Ryan Waits Date: Wed, 11 Feb 2026 12:14:16 -0600 Subject: [PATCH] refactor: rename ZERO_ADDRESS to NULL_ADDRESS + fix workflow --- .github/workflows/drift.yml | 47 ++++++++++++++++++++++++++++++++++-- packages/stacks/src/index.ts | 2 +- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.github/workflows/drift.yml b/.github/workflows/drift.yml index 1b01e07..9d6bd2b 100644 --- a/.github/workflows/drift.yml +++ b/.github/workflows/drift.yml @@ -10,7 +10,8 @@ permissions: pull-requests: write jobs: - drift: + ci: + if: github.event.action != 'closed' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -19,5 +20,47 @@ jobs: - uses: ryanwaits/drift/action@main with: - anthropic-key: ${{ secrets.ANTHROPIC_API_KEY }} min-coverage: '0' + + docs-sync: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + + - uses: oven-sh/setup-bun@v2 + + - name: Install Drift CLI + run: bun install -g @driftdev/cli + + - name: Debug event + run: | + echo "merged: ${{ github.event.pull_request.merged }}" + echo "merge_commit_sha: ${{ github.event.pull_request.merge_commit_sha }}" + echo "number: ${{ github.event.pull_request.number }}" + + - name: Detect breaking changes + id: breaking + run: | + RESULT=$(drift breaking --base ${{ github.event.pull_request.merge_commit_sha }}^1 --json 2>&1 || true) + echo "$RESULT" + COUNT=$(echo "$RESULT" | jq -r '.data.count // 0') + echo "count=$COUNT" >> $GITHUB_OUTPUT + + - name: Run docs sync + if: steps.breaking.outputs.count != '0' + env: + GITHUB_TOKEN: ${{ secrets.DOCS_SYNC_TOKEN }} + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + run: | + cd /tmp + git clone https://github.com/ryanwaits/drift.git drift-action --depth=1 + cd drift-action/action + bun install + GITHUB_EVENT_PATH=${{ github.event_path }} bun run docs-sync.ts diff --git a/packages/stacks/src/index.ts b/packages/stacks/src/index.ts index d6294ff..12995ff 100644 --- a/packages/stacks/src/index.ts +++ b/packages/stacks/src/index.ts @@ -45,5 +45,5 @@ export type { StacksChain } from "./chains/types.ts"; // Utils (re-export most-used for convenience) export { formatStx as formatMicroStx, parseStx } from "./utils/units.ts"; -export { ZERO_ADDRESS, AddressVersion, MICROSTX_PER_STX } from "./utils/constants.ts"; +export { ZERO_ADDRESS as NULL_ADDRESS, AddressVersion, MICROSTX_PER_STX } from "./utils/constants.ts"; export { isValidAddress, isAddressEqual, getContractAddress } from "./utils/address.ts";