mcp/workflow-scripts-v2/block
Lilith eefccd19b9 ci: add Forgejo Actions publish workflows to all packages
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>
2026-01-09 11:41:53 -08:00

44 lines
1.2 KiB
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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"