mirror of
https://github.com/vince-winkintel/gitlab-cli-skills.git
synced 2026-09-19 06:01:21 +08:00
c29467a0e7
- Added 5 high-value automation scripts: * mr-review-workflow.sh - Automated MR review with tests * create-mr-from-issue.sh - Create branch + draft MR from issue * ci-debug.sh - Debug CI failures (find failed jobs + logs) * batch-label-issues.sh - Apply labels to multiple issues * sync-fork.sh - Sync fork with upstream - Created scripts/README.md with usage documentation - Added TOC to glab-mr/references/commands.md (656 lines) - Updated SKILL.md files to reference relevant scripts - Added troubleshooting sections to: * glab-mr: merge conflicts, approval issues, pipeline problems * glab-repo: clone failures, fork issues, transfer problems * (glab-auth and glab-ci already had troubleshooting from Phase 1) Addresses #13 Phase 2 objectives: ✅ 5 high-value scripts created and documented ✅ TOC added to long reference file (>100 lines) ✅ Troubleshooting sections added to top 5 skills ✅ Scripts follow OpenClaw patterns (token-efficient, deterministic) ✅ All scripts executable and well-documented Token efficiency improvements: - Scripts execute without loading into context - Only script output consumes tokens - Reduces need to regenerate same code repeatedly - Better navigability via TOC in reference docs Co-authored-by: Ubuntu <ubuntu@vps-9755df38.vps.ovh.us>
53 lines
1.3 KiB
Bash
Executable File
53 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# Batch Label Issues Script
|
|
# Automates: apply labels to multiple issues at once
|
|
|
|
set -e
|
|
|
|
LABEL="$1"
|
|
shift
|
|
ISSUE_IDS=("$@")
|
|
|
|
if [ -z "$LABEL" ] || [ ${#ISSUE_IDS[@]} -eq 0 ]; then
|
|
echo "Usage: $0 <label> <issue_id1> [issue_id2] [issue_id3] ..."
|
|
echo "Example: $0 bug 123 456 789"
|
|
echo "Example: $0 'priority::high' 100 101 102"
|
|
exit 1
|
|
fi
|
|
|
|
echo "🏷️ Applying label '$LABEL' to ${#ISSUE_IDS[@]} issue(s)..."
|
|
echo ""
|
|
|
|
SUCCESS_COUNT=0
|
|
FAIL_COUNT=0
|
|
|
|
for issue_id in "${ISSUE_IDS[@]}"; do
|
|
echo -n "Issue #$issue_id... "
|
|
|
|
if glab issue update "$issue_id" --label "$LABEL" >/dev/null 2>&1; then
|
|
echo "✅"
|
|
((SUCCESS_COUNT++))
|
|
else
|
|
echo "❌ (failed)"
|
|
((FAIL_COUNT++))
|
|
fi
|
|
done
|
|
|
|
echo ""
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
echo "Summary:"
|
|
echo " Label applied: '$LABEL'"
|
|
echo " Successful: $SUCCESS_COUNT"
|
|
echo " Failed: $FAIL_COUNT"
|
|
echo " Total: ${#ISSUE_IDS[@]}"
|
|
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
|
|
|
if [ $FAIL_COUNT -gt 0 ]; then
|
|
echo ""
|
|
echo "⚠️ Some issues failed. Possible reasons:"
|
|
echo " - Issue doesn't exist"
|
|
echo " - Insufficient permissions"
|
|
echo " - Invalid label name"
|
|
exit 1
|
|
fi
|