@codyswann/lisa 2.195.8 → 2.196.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/all/github-rulesets/base.json +64 -0
- package/all/github-rulesets/prevent-delete.json +25 -0
- package/all/github-rulesets/protect-tags.json +31 -0
- package/expo/github-rulesets/playwright.json +38 -0
- package/package.json +2 -2
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-github-repo/SKILL.md +66 -0
- package/plugins/lisa/.codex-plugin/skills/lisa-setup-github-repo/agents/openai.yaml +4 -0
- package/plugins/lisa/commands/lisa/setup/github-repo.md +7 -0
- package/plugins/lisa/skills/lisa-setup-github-repo/SKILL.md +66 -0
- package/plugins/lisa/skills/lisa-setup-github-repo/agents/openai.yaml +4 -0
- package/plugins/lisa-agy/commands/lisa/setup/github-repo.md +7 -0
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-agy/skills/lisa-setup-github-repo/SKILL.md +66 -0
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/commands/lisa/setup/github-repo.md +7 -0
- package/plugins/lisa-copilot/skills/lisa-setup-github-repo/SKILL.md +66 -0
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/commands/lisa/setup/github-repo.md +7 -0
- package/plugins/lisa-cursor/skills/lisa-setup-github-repo/SKILL.md +66 -0
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/src/base/commands/lisa/setup/github-repo.md +7 -0
- package/plugins/src/base/skills/lisa-setup-github-repo/SKILL.md +66 -0
- package/rails/github-rulesets/quality-checks.json +51 -0
- package/scripts/cleanup-github-branches.sh +96 -72
- package/scripts/cleanup-local-merged-branches.sh +110 -0
- package/scripts/cleanup-worktrees.sh +222 -0
- package/scripts/lisa-github-repo-settings.sh +152 -0
- package/scripts/lisa-github-repo-setup.sh +73 -0
- package/scripts/lisa-github-rulesets.sh +612 -0
- package/scripts/setup-deploy-key.sh +62 -2
- package/typescript/github-rulesets/quality-checks.json +67 -0
- package/typescript/github-rulesets/base.json +0 -33
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# lisa-github-repo-settings.sh
|
|
4
|
+
#
|
|
5
|
+
# Applies Lisa's baseline GitHub repository settings via the gh CLI:
|
|
6
|
+
# - merge commits on, squash and rebase merging off (merge-only fleet policy)
|
|
7
|
+
# - merge commit title/message from the PR (MERGE_MESSAGE / PR_TITLE)
|
|
8
|
+
# - auto-merge enabled
|
|
9
|
+
# - head branches deleted after merge (environment branches survive via
|
|
10
|
+
# the deletion rule in Lisa's rulesets — GitHub never deletes a branch
|
|
11
|
+
# a ruleset protects)
|
|
12
|
+
# - "always suggest updating pull request branches" enabled
|
|
13
|
+
# - GitHub wiki tab disabled (Lisa projects use in-repo wiki/)
|
|
14
|
+
# - secret scanning + push protection enabled where the plan supports it
|
|
15
|
+
#
|
|
16
|
+
# Per-repo overrides come from .lisa.config.json:
|
|
17
|
+
# { "github": { "settings": { "allow_auto_merge": false } } }
|
|
18
|
+
# Any key in github.settings replaces the baseline value for that repo.
|
|
19
|
+
#
|
|
20
|
+
# Usage:
|
|
21
|
+
# lisa-github-repo-settings.sh [options] [project-path]
|
|
22
|
+
#
|
|
23
|
+
# Options:
|
|
24
|
+
# -n, --dry-run Show the settings payload without applying it
|
|
25
|
+
# -v, --verbose Show detailed output
|
|
26
|
+
# -h, --help Show this help message
|
|
27
|
+
#
|
|
28
|
+
# Requires:
|
|
29
|
+
# - gh CLI (authenticated with repo admin permissions)
|
|
30
|
+
# - jq
|
|
31
|
+
#
|
|
32
|
+
|
|
33
|
+
set -eo pipefail
|
|
34
|
+
|
|
35
|
+
RED='\033[0;31m'
|
|
36
|
+
GREEN='\033[0;32m'
|
|
37
|
+
YELLOW='\033[0;33m'
|
|
38
|
+
BLUE='\033[0;34m'
|
|
39
|
+
NC='\033[0m'
|
|
40
|
+
|
|
41
|
+
DRY_RUN=false
|
|
42
|
+
VERBOSE=false
|
|
43
|
+
PROJECT_PATH=""
|
|
44
|
+
|
|
45
|
+
log_info() { echo -e "${BLUE}ℹ${NC} $1"; }
|
|
46
|
+
log_success() { echo -e "${GREEN}✓${NC} $1"; }
|
|
47
|
+
log_warning() { echo -e "${YELLOW}⚠${NC} $1"; }
|
|
48
|
+
log_error() { echo -e "${RED}✗${NC} $1" >&2; }
|
|
49
|
+
log_verbose() { [[ "$VERBOSE" == "true" ]] && echo -e " $1" || true; }
|
|
50
|
+
|
|
51
|
+
show_help() {
|
|
52
|
+
sed -n '2,32p' "$0" | sed 's/^# \{0,1\}//'
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
baseline_settings() {
|
|
56
|
+
jq -n '{
|
|
57
|
+
allow_merge_commit: true,
|
|
58
|
+
allow_squash_merge: false,
|
|
59
|
+
allow_rebase_merge: false,
|
|
60
|
+
allow_auto_merge: true,
|
|
61
|
+
allow_update_branch: true,
|
|
62
|
+
delete_branch_on_merge: true,
|
|
63
|
+
merge_commit_title: "MERGE_MESSAGE",
|
|
64
|
+
merge_commit_message: "PR_TITLE",
|
|
65
|
+
web_commit_signoff_required: false,
|
|
66
|
+
has_issues: true,
|
|
67
|
+
has_wiki: false
|
|
68
|
+
}'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
# Merge .lisa.config.json github.settings overrides on top of the baseline.
|
|
72
|
+
resolved_settings() {
|
|
73
|
+
local project_path="$1"
|
|
74
|
+
local overrides="{}"
|
|
75
|
+
|
|
76
|
+
if [[ -f "$project_path/.lisa.config.json" ]]; then
|
|
77
|
+
if ! overrides=$(jq '.github.settings // {}' "$project_path/.lisa.config.json" 2>/dev/null); then
|
|
78
|
+
log_warning ".lisa.config.json could not be parsed — ignoring github.settings overrides" >&2
|
|
79
|
+
overrides="{}"
|
|
80
|
+
fi
|
|
81
|
+
fi
|
|
82
|
+
|
|
83
|
+
jq -n --argjson base "$(baseline_settings)" --argjson over "$overrides" '$base * $over'
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
main() {
|
|
87
|
+
while [[ $# -gt 0 ]]; do
|
|
88
|
+
case $1 in
|
|
89
|
+
-n|--dry-run) DRY_RUN=true; shift ;;
|
|
90
|
+
-v|--verbose) VERBOSE=true; shift ;;
|
|
91
|
+
-h|--help) show_help; exit 0 ;;
|
|
92
|
+
-*) log_error "Unknown option: $1"; show_help; exit 1 ;;
|
|
93
|
+
*) PROJECT_PATH="$1"; shift ;;
|
|
94
|
+
esac
|
|
95
|
+
done
|
|
96
|
+
|
|
97
|
+
PROJECT_PATH="${PROJECT_PATH:-.}"
|
|
98
|
+
PROJECT_PATH="$(cd "$PROJECT_PATH" && pwd)"
|
|
99
|
+
|
|
100
|
+
if ! command -v gh &> /dev/null || ! command -v jq &> /dev/null; then
|
|
101
|
+
log_error "Requires gh and jq"
|
|
102
|
+
exit 1
|
|
103
|
+
fi
|
|
104
|
+
if ! gh auth status &> /dev/null; then
|
|
105
|
+
log_error "GitHub CLI is not authenticated. Run 'gh auth login' first."
|
|
106
|
+
exit 1
|
|
107
|
+
fi
|
|
108
|
+
|
|
109
|
+
cd "$PROJECT_PATH"
|
|
110
|
+
local repo
|
|
111
|
+
repo=$(gh repo view --json nameWithOwner -q '.nameWithOwner' 2>/dev/null) || {
|
|
112
|
+
log_error "Could not determine repository for $PROJECT_PATH"
|
|
113
|
+
exit 1
|
|
114
|
+
}
|
|
115
|
+
log_info "Repository: $repo"
|
|
116
|
+
|
|
117
|
+
local settings
|
|
118
|
+
settings=$(resolved_settings "$PROJECT_PATH")
|
|
119
|
+
log_verbose "Settings payload: $(echo "$settings" | jq -c .)"
|
|
120
|
+
|
|
121
|
+
if [[ "$DRY_RUN" == "true" ]]; then
|
|
122
|
+
log_info "[DRY RUN] Would apply settings:"
|
|
123
|
+
echo "$settings" | jq .
|
|
124
|
+
log_info "[DRY RUN] Would enable secret scanning + push protection (best effort)"
|
|
125
|
+
return 0
|
|
126
|
+
fi
|
|
127
|
+
|
|
128
|
+
# Auto-merge isn't available on every plan; if the full payload is
|
|
129
|
+
# rejected, retry without it rather than failing the whole baseline.
|
|
130
|
+
if echo "$settings" | gh api -X PATCH "repos/$repo" --input - > /dev/null 2>&1; then
|
|
131
|
+
log_success "Applied repository settings"
|
|
132
|
+
else
|
|
133
|
+
log_warning "Full settings payload rejected — retrying without allow_auto_merge"
|
|
134
|
+
if echo "$settings" | jq 'del(.allow_auto_merge)' | gh api -X PATCH "repos/$repo" --input - > /dev/null; then
|
|
135
|
+
log_success "Applied repository settings (auto-merge unavailable on this plan)"
|
|
136
|
+
else
|
|
137
|
+
log_error "Failed to apply repository settings"
|
|
138
|
+
exit 1
|
|
139
|
+
fi
|
|
140
|
+
fi
|
|
141
|
+
|
|
142
|
+
# Secret scanning + push protection: free on public repos, requires GHAS on
|
|
143
|
+
# private ones — enable where the API allows, skip quietly otherwise.
|
|
144
|
+
if jq -n '{security_and_analysis: {secret_scanning: {status: "enabled"}, secret_scanning_push_protection: {status: "enabled"}}}' \
|
|
145
|
+
| gh api -X PATCH "repos/$repo" --input - > /dev/null 2>&1; then
|
|
146
|
+
log_success "Enabled secret scanning + push protection"
|
|
147
|
+
else
|
|
148
|
+
log_warning "Secret scanning not available on this repository's plan — skipped"
|
|
149
|
+
fi
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
main "$@"
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# lisa-github-repo-setup.sh
|
|
4
|
+
#
|
|
5
|
+
# One-shot GitHub repository governance setup for a Lisa project:
|
|
6
|
+
# 1. Repository settings baseline (lisa-github-repo-settings.sh)
|
|
7
|
+
# 2. Branch + tag rulesets from Lisa templates (lisa-github-rulesets.sh)
|
|
8
|
+
# 3. CI deploy key + DEPLOY_KEY secret (setup-deploy-key.sh --yes),
|
|
9
|
+
# so release workflows can push version bumps through the rulesets'
|
|
10
|
+
# DeployKey bypass.
|
|
11
|
+
#
|
|
12
|
+
# Usage:
|
|
13
|
+
# lisa-github-repo-setup.sh [options] [project-path]
|
|
14
|
+
#
|
|
15
|
+
# Options:
|
|
16
|
+
# -n, --dry-run Show what would be done without making changes
|
|
17
|
+
# -v, --verbose Show detailed output
|
|
18
|
+
# -h, --help Show this help message
|
|
19
|
+
#
|
|
20
|
+
# Requires:
|
|
21
|
+
# - gh CLI (authenticated with repo admin permissions)
|
|
22
|
+
# - jq, ssh-keygen
|
|
23
|
+
#
|
|
24
|
+
|
|
25
|
+
set -eo pipefail
|
|
26
|
+
|
|
27
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
28
|
+
|
|
29
|
+
DRY_RUN=false
|
|
30
|
+
VERBOSE=false
|
|
31
|
+
PROJECT_PATH=""
|
|
32
|
+
PASSTHROUGH=()
|
|
33
|
+
|
|
34
|
+
while [[ $# -gt 0 ]]; do
|
|
35
|
+
case $1 in
|
|
36
|
+
-n|--dry-run) DRY_RUN=true; PASSTHROUGH+=("--dry-run"); shift ;;
|
|
37
|
+
-v|--verbose) VERBOSE=true; PASSTHROUGH+=("--verbose"); shift ;;
|
|
38
|
+
-h|--help) sed -n '2,24p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
|
|
39
|
+
-*) echo "Unknown option: $1" >&2; exit 1 ;;
|
|
40
|
+
*) PROJECT_PATH="$1"; shift ;;
|
|
41
|
+
esac
|
|
42
|
+
done
|
|
43
|
+
|
|
44
|
+
PROJECT_PATH="${PROJECT_PATH:-.}"
|
|
45
|
+
PROJECT_PATH="$(cd "$PROJECT_PATH" && pwd)"
|
|
46
|
+
|
|
47
|
+
echo "==> Step 1/3: repository settings"
|
|
48
|
+
bash "$SCRIPT_DIR/lisa-github-repo-settings.sh" "${PASSTHROUGH[@]}" "$PROJECT_PATH"
|
|
49
|
+
|
|
50
|
+
echo ""
|
|
51
|
+
echo "==> Step 2/3: rulesets"
|
|
52
|
+
bash "$SCRIPT_DIR/lisa-github-rulesets.sh" --yes "${PASSTHROUGH[@]}" "$PROJECT_PATH"
|
|
53
|
+
|
|
54
|
+
echo ""
|
|
55
|
+
echo "==> Step 3/3: deploy key"
|
|
56
|
+
if [[ "$DRY_RUN" == "true" ]]; then
|
|
57
|
+
echo "[DRY RUN] Would ensure a write-access deploy key + DEPLOY_KEY secret exist"
|
|
58
|
+
else
|
|
59
|
+
deploy_output=$(cd "$PROJECT_PATH" && bash "$SCRIPT_DIR/setup-deploy-key.sh" --yes 2>&1)
|
|
60
|
+
deploy_rc=$?
|
|
61
|
+
echo "$deploy_output"
|
|
62
|
+
if [[ $deploy_rc -ne 0 ]]; then
|
|
63
|
+
if echo "$deploy_output" | grep -qi "deploy keys are disabled"; then
|
|
64
|
+
# Org policy, not a repo problem — settings/rulesets still applied.
|
|
65
|
+
echo "⚠ Deploy keys are disabled by organization policy — skipped. Release workflows needing DEPLOY_KEY will not work until an org admin re-enables deploy keys."
|
|
66
|
+
else
|
|
67
|
+
exit $deploy_rc
|
|
68
|
+
fi
|
|
69
|
+
fi
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
echo ""
|
|
73
|
+
echo "✓ GitHub repository governance setup complete"
|