From fe6f053e0ec7ecf5058fc572b11bbbecddd1874c Mon Sep 17 00:00:00 2001 From: Konstantin Wohlwend Date: Thu, 21 May 2026 16:22:04 -0700 Subject: [PATCH] Update workflows --- .claude/CLAUDE-KNOWLEDGE.md | 2 +- .github/workflows/mirror-to-wdb.yaml | 36 -------------- .github/workflows/npm-publish.yaml | 2 + .github/workflows/sync-main-to-dev.yml | 68 -------------------------- 4 files changed, 3 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/mirror-to-wdb.yaml delete mode 100644 .github/workflows/sync-main-to-dev.yml diff --git a/.claude/CLAUDE-KNOWLEDGE.md b/.claude/CLAUDE-KNOWLEDGE.md index 7082858a2..595e04c1b 100644 --- a/.claude/CLAUDE-KNOWLEDGE.md +++ b/.claude/CLAUDE-KNOWLEDGE.md @@ -513,4 +513,4 @@ A: Seed the normal initial environment config before marking the project as `isD A: React error #185 is a maximum update depth error. In the dashboard root, `useSyncExternalStore` snapshot getters must return cached referentially stable values. Returning a fresh object such as `{ status: "healthy" }` from `getSnapshot` on every call can make React think the external store changed on every render and loop immediately. Use module-level constants for stable snapshots. ## Q: How should the npm publish workflow create the post-publish dev version bump? -A: The workflow needs `contents: write` and a full checkout so it can fetch `origin/dev`, check out `dev`, create a non-interactive patch changeset, run `pnpm changeset version`, copy the generated `packages/template/package.json` version line back into `packages/template/package-template.json`, and commit/push `chore: update package versions` only when files are staged. +A: The workflow needs a full checkout using the fine-grained `NPM_PUBLISH_VERSION_UPDATE_PR_PAT` secret. It then fetches `origin/dev`, checks out `dev`, creates a non-interactive patch changeset, runs `pnpm changeset version`, copies the generated `packages/template/package.json` version line back into `packages/template/package-template.json`, and commit/pushes `chore: update package versions`. Because direct pushes to `dev` are blocked by repository rules requiring PRs and the `all-good` status check, the PAT's owning user or bot account must be added to the ruleset bypass list with "Always allow" rather than "For pull requests only". diff --git a/.github/workflows/mirror-to-wdb.yaml b/.github/workflows/mirror-to-wdb.yaml deleted file mode 100644 index 5c0565480..000000000 --- a/.github/workflows/mirror-to-wdb.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Mirror main branch to main-mirror-for-wdb - -on: - push: - branches: - - main - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }} - -jobs: - lint_and_build: - permissions: - contents: write - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - - - name: Mirror branch - run: | - git pull --all - git switch -c main-mirror-for-wdb - git reset --hard origin/main - - - name: Trigger rebuild - run: | - git config --global user.email "github-actions[bot]@users.noreply.github.com" - git config --global user.name "github-actions[bot]" - git commit --allow-empty -m "Trigger Vercel rebuild" - - - name: Push branch - run: | - git push -f origin main-mirror-for-wdb diff --git a/.github/workflows/npm-publish.yaml b/.github/workflows/npm-publish.yaml index 51ed737e2..aa0d781f5 100644 --- a/.github/workflows/npm-publish.yaml +++ b/.github/workflows/npm-publish.yaml @@ -16,11 +16,13 @@ concurrency: jobs: publish: runs-on: ubuntu-latest + environment: "hexclave/stack-auth — Publish npm packages" steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 + token: ${{ secrets.NPM_PUBLISH_VERSION_UPDATE_PR_PAT }} - name: Setup Node.js uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 diff --git a/.github/workflows/sync-main-to-dev.yml b/.github/workflows/sync-main-to-dev.yml deleted file mode 100644 index 1d5ccd0cb..000000000 --- a/.github/workflows/sync-main-to-dev.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Sync Main to Dev - -on: - push: - branches: - - main - -jobs: - sync-commits: - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 - with: - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Configure Git - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Sync main commits to dev - run: | - # Fetch all branches - git fetch origin dev:dev - - # Switch to dev branch - git checkout dev - - # Find commits on main that are not on dev - COMMITS_TO_CHERRY_PICK=$(git rev-list --reverse main ^dev) - - if [ -z "$COMMITS_TO_CHERRY_PICK" ]; then - echo "No commits to sync from main to dev" - exit 0 - fi - - echo "Found commits to cherry-pick:" - echo "$COMMITS_TO_CHERRY_PICK" - - # Cherry-pick each commit - SUCCESS=true - for COMMIT in $COMMITS_TO_CHERRY_PICK; do - echo "Cherry-picking commit: $COMMIT" - if ! git cherry-pick $COMMIT; then - echo "Cherry-pick failed for commit $COMMIT" - # Try to continue with --allow-empty in case it's already applied - if ! git cherry-pick --continue --allow-empty 2>/dev/null; then - echo "Failed to cherry-pick $COMMIT, aborting" - git cherry-pick --abort - SUCCESS=false - break - fi - fi - done - - if [ "$SUCCESS" = true ]; then - # Push changes to dev - git push origin dev - echo "Successfully synced commits from main to dev" - else - echo "Failed to sync some commits" - exit 1 - fi