Skip to content

refactor(workflow): auto-publish in mktsk and commit when standalone#450

Merged
RyderFreeman4Logos merged 3 commits intomainfrom
refactor/workflow-auto-publish
Mar 21, 2026
Merged

refactor(workflow): auto-publish in mktsk and commit when standalone#450
RyderFreeman4Logos merged 3 commits intomainfrom
refactor/workflow-auto-publish

Conversation

@RyderFreeman4Logos
Copy link
Owner

Summary

  • Add CSA_SKIP_PUBLISH env var protocol so mktsk and commit complete the full pipeline (push → PR → pr-codex-bot → merge) when used standalone
  • When called from a parent workflow (dev2merge), publish steps are skipped — parent handles them
  • Eliminates the gap where workflows stop after PR creation, requiring manual /pr-codex-bot invocation

Changes

  • mktsk: Add Step 6 (Publish Transaction) and Step 7 (Post-Merge Sync) with CSA_SKIP_PUBLISH gate
  • commit: Replace IS_MILESTONE condition on Steps 21/22 with !(SKIP_PUBLISH), initialized from CSA_SKIP_PUBLISH env var; resolve BRANCH from git in standalone mode
  • dev2merge: Pass CSA_SKIP_PUBLISH=true when invoking mktsk in Step 9
  • PATTERN.md/SKILL.md: Synchronized for both patterns

Control flow

Path CSA_SKIP_PUBLISH Result
standalone /commit unset Step 22: push+PR+pr-codex-bot
standalone /mktsk unset Step 6: version bump+review+push+PR+pr-codex-bot
dev2merge → mktsk true mktsk Step 6 skips; dev2merge Steps 10-13 handle
mktsk → commit true commit Step 22 skips; mktsk Step 6 handles

Test plan

  • weave compile-all passes (17/17 OK)
  • Pre-commit hooks pass (fmt, clippy, deny, test, e2e)
  • Review findings (P1: review gate bypass, P1: BRANCH unset, P2: pattern sync) all addressed

🤖 Generated with Claude Code

Add CSA_SKIP_PUBLISH env var protocol so mktsk and commit complete the
full pipeline (push → PR → pr-codex-bot → merge) when used standalone,
while skipping publish when called from a parent workflow like dev2merge.

Changes:
- mktsk: add Step 6 (Publish Transaction) and Step 7 (Post-Merge Sync)
  with CSA_SKIP_PUBLISH gate
- commit: replace IS_MILESTONE condition on Steps 21/22 with
  !(SKIP_PUBLISH), initialized from CSA_SKIP_PUBLISH env var
- dev2merge: pass CSA_SKIP_PUBLISH=true when invoking mktsk in Step 9
- Update SKILL.md and PATTERN.md for both patterns

This ensures no workflow path creates a PR without continuing to
pr-codex-bot, eliminating the manual intervention gap.
- mktsk: replace `|| true` on cumulative review with hard gate that
  exits non-zero on review failure (P1: prevents pushing unreviewed code)
- commit: resolve BRANCH from git when unset in standalone mode
  (P1: prevents `git push -u origin ""` failure)
- commit: sync PATTERN.md with workflow.toml — replace IS_MILESTONE
  with SKIP_PUBLISH condition (P2: pattern/workflow sync)
- commit: remove stale `milestone=true` example from SKILL.md
@RyderFreeman4Logos
Copy link
Owner Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f8baf4ae5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

```'''
on_fail = "abort"
condition = "${IS_MILESTONE}"
condition = "!(${SKIP_PUBLISH})"

Choose a reason for hiding this comment

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

P1 Badge Keep /sa from auto-publishing every successful commit

Changing the commit publish gate to !(${SKIP_PUBLISH}) makes auto-push/PR the default for any caller that does not explicitly export CSA_SKIP_PUBLISH=true. I checked patterns/sa/workflow.toml:241-253, and /sa still includes commit whenever REVIEW_IS_CLEAN without setting that variable, so a clean /sa run now pushes the branch, opens/reuses a PR, and triggers pr-codex-bot even when the user only wanted a local commit. Before this change /sa relied on the old milestone gate, so this is a behavioral regression for an existing parent workflow.

Useful? React with 👍 / 👎.

Comment on lines +128 to +129
BRANCH="$(git branch --show-current)"
git push -u origin "${BRANCH}" --force-with-lease

Choose a reason for hiding this comment

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

P1 Badge Block standalone mktsk from pushing protected branches

The new standalone publish path never validates that BRANCH is a feature branch before pushing. Unlike /commit and scripts/hooks/post-pr-create.sh, Step 6 goes straight to git push -u origin "${BRANCH}" --force-with-lease; if someone runs /mktsk from main or dev, a workflow that previously stopped at local verification now attempts a direct push to that protected branch before PR creation even starts. The skill docs already say mktsk must run on a feature branch, but this step does not enforce it.

Useful? React with 👍 / 👎.

- sa: set CSA_SKIP_PUBLISH=true before including commit workflow,
  preventing /sa from auto-pushing on every clean commit (P1)
- mktsk: add branch safety check in Step 6 — refuse to push
  protected branches (main/dev) in standalone mode (P1)
@RyderFreeman4Logos
Copy link
Owner Author

Bot review findings addressed in commit 951c5b2:

  1. P1: /sa auto-publishing on every clean commit — Fixed by setting CSA_SKIP_PUBLISH=true in sa Step 12 before including commit workflow. sa owns its own publish lifecycle.

  2. P1: mktsk standalone publish from protected branch — Fixed by adding branch safety check at the start of Step 6: refuses to push if on main/dev.

Both findings from @codex review at 2026-03-21T14:57:30Z were confirmed real issues and resolved.

@RyderFreeman4Logos RyderFreeman4Logos merged commit 19c3f07 into main Mar 21, 2026
4 of 6 checks passed
@chatgpt-codex-connector
Copy link

To use Codex here, create an environment for this repo.

@RyderFreeman4Logos RyderFreeman4Logos deleted the refactor/workflow-auto-publish branch March 21, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant