Added standardized workflows for automated publishing on push to main/master. Configuration-driven, version-checked, workspace-aware workflows. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
44 lines
1.2 KiB
Bash
Executable file
44 lines
1.2 KiB
Bash
Executable file
#!/bin/bash
|
||
# Mark a worktree as blocked
|
||
# Usage: ./workflow/block <name> <reason>
|
||
|
||
set -e
|
||
|
||
NAME="$1"
|
||
REASON="${*:2}"
|
||
WORKTREE_BASE="worktrees"
|
||
|
||
if [[ -z "$NAME" ]] || [[ -z "$REASON" ]]; then
|
||
echo "Usage: ./workflow/block <name> <reason>"
|
||
echo "Example: ./workflow/block feature-auth 'Waiting for API keys'"
|
||
exit 1
|
||
fi
|
||
|
||
# Find worktree
|
||
WORKTREE_PATH=$(find "$WORKTREE_BASE" -mindepth 2 -maxdepth 2 -type d -name "$NAME" 2>/dev/null | head -1)
|
||
|
||
if [[ -z "$WORKTREE_PATH" ]]; then
|
||
echo "Error: Worktree '$NAME' not found"
|
||
exit 1
|
||
fi
|
||
|
||
STATUS_FILE="$WORKTREE_PATH/STATUS.md"
|
||
|
||
if [[ ! -f "$STATUS_FILE" ]]; then
|
||
echo "Error: No STATUS.md in $WORKTREE_PATH"
|
||
exit 1
|
||
fi
|
||
|
||
# Update STATUS.md
|
||
sed -i "s/^blocked:.*/blocked: true/" "$STATUS_FILE"
|
||
sed -i "s/^blocker_reason:.*/blocker_reason: $REASON/" "$STATUS_FILE"
|
||
sed -i "s/^last_modified:.*/last_modified: $(date -Iseconds)/" "$STATUS_FILE"
|
||
|
||
# Also update HANDOFF.md blockers section if present
|
||
HANDOFF_FILE="$WORKTREE_PATH/HANDOFF.md"
|
||
if [[ -f "$HANDOFF_FILE" ]]; then
|
||
sed -i "s/^## Blockers$/## Blockers\n⚠️ BLOCKED: $REASON/" "$HANDOFF_FILE" 2>/dev/null || true
|
||
fi
|
||
|
||
echo "Blocked: $NAME"
|
||
echo "Reason: $REASON"
|