@hybridlabor-api/aos 4.8.0 → 4.10.0
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/.agents/{agents.md → AGENTS.md} +3 -1
- package/.agents/nodes.json +3 -1
- package/.agents/vendor-manifest.json +23 -1
- package/.claude/agents/godmode-media-eventtech.md +1 -1
- package/.claude/hooks/conventional-commits.mjs +125 -0
- package/.claude/hooks/env-file-protection.mjs +105 -0
- package/.claude/hooks/go-gate.mjs +101 -81
- package/.claude/hooks/memb-inject.mjs +29 -1
- package/.claude/settings.json +13 -0
- package/.claude/workflows/startcycle-dispatch.mjs +23 -1
- package/.opencode/agents/godmode-media-eventtech.md +1 -1
- package/.opencode/plugins/bdb-aos.js +31 -4
- package/CLAUDE.md +0 -571
- package/README.de.md +1 -1
- package/README.md +1 -1
- package/README.pt.md +1 -1
- package/THIRD_PARTY_NOTICES.md +126 -0
- package/bin/aos-doctor.mjs +1 -1
- package/docs/skills_table.md +1 -1
- package/installer.js +187 -55
- package/package.json +7 -3
- package/packages/aos-cli/README.md +80 -0
- package/packages/aos-cli/bin/aos-cli.mjs +134 -0
- package/packages/aos-cli/core-skills.json +12 -0
- package/packages/aos-cli/extensions/aos.ts +321 -0
- package/packages/aos-cli/package-lock.json +1923 -0
- package/packages/aos-cli/package.json +29 -0
- package/packages/aos-cli/scripts/check-theme.mjs +63 -0
- package/packages/aos-cli/themes/aos.json +97 -0
- package/scripts/build-plugin-manifest.mjs +131 -0
- package/scripts/validate-skills.mjs +81 -6
- package/skills/basic/ao-orchestrator/SKILL.md +116 -0
- package/skills/basic/bdb-eventagency-skill/SKILL.md +252 -0
- package/skills/basic/bdb-shipping-skill/SKILL.md +161 -0
- package/skills/basic/godmode-eventtech/SKILL.md +4 -1
- package/skills/global_config/agenttrail/SKILL.md +6 -1
- package/skills/global_config/aos-project-init/SKILL.md +2 -0
- package/skills/global_config/aos-project-init/assets/AGENTS.template.md +1 -1
- package/skills/global_config/aos-project-init/scripts/aos-project-doctor.mjs +1 -1
- package/skills/global_config/aos-setup/SKILL.md +1 -1
- package/skills/global_config/aos-setup/scripts/aos-doctor.mjs +1 -1
- package/skills/global_config/ask-tim/SKILL.md +7 -7
- package/skills/global_config/bash-script-generator/SKILL.md +201 -0
- package/skills/global_config/bash-script-generator/assets/templates/standard-template.sh +96 -0
- package/skills/global_config/bash-script-generator/docs/bash-scripting-guide.md +729 -0
- package/skills/global_config/bash-script-generator/docs/generation-best-practices.md +193 -0
- package/skills/global_config/bash-script-generator/docs/script-patterns.md +566 -0
- package/skills/global_config/bash-script-generator/docs/text-processing-guide.md +437 -0
- package/skills/global_config/bash-script-generator/examples/log-analyzer.sh +92 -0
- package/skills/global_config/bash-script-generator/scripts/generate_script_template.sh +123 -0
- package/skills/global_config/bash-script-generator/scripts/run_ci_checks.sh +172 -0
- package/skills/global_config/bash-script-generator/scripts/test_generator.sh +413 -0
- package/skills/global_config/bash-script-validator/SKILL.md +249 -0
- package/skills/global_config/bash-script-validator/docs/awk-reference.md +449 -0
- package/skills/global_config/bash-script-validator/docs/bash-reference.md +468 -0
- package/skills/global_config/bash-script-validator/docs/common-mistakes.md +623 -0
- package/skills/global_config/bash-script-validator/docs/grep-reference.md +395 -0
- package/skills/global_config/bash-script-validator/docs/regex-reference.md +391 -0
- package/skills/global_config/bash-script-validator/docs/sed-reference.md +454 -0
- package/skills/global_config/bash-script-validator/docs/shell-reference.md +463 -0
- package/skills/global_config/bash-script-validator/docs/shellcheck-reference.md +399 -0
- package/skills/global_config/bash-script-validator/examples/bad-bash.sh +55 -0
- package/skills/global_config/bash-script-validator/examples/bad-shell.sh +54 -0
- package/skills/global_config/bash-script-validator/examples/good-bash.sh +71 -0
- package/skills/global_config/bash-script-validator/examples/good-shell.sh +69 -0
- package/skills/global_config/bash-script-validator/scripts/run_ci_checks.sh +23 -0
- package/skills/global_config/bash-script-validator/scripts/shellcheck_wrapper.sh +174 -0
- package/skills/global_config/bash-script-validator/scripts/test_validate.sh +446 -0
- package/skills/global_config/bash-script-validator/scripts/validate.sh +512 -0
- package/skills/global_config/ci-pipeline/SKILL.md +135 -0
- package/skills/global_config/deja-memory/SKILL.md +3 -1
- package/skills/global_config/dispatching-parallel-agents/SKILL.md +170 -0
- package/skills/global_config/dockerfile-generator/SKILL.md +1038 -0
- package/skills/global_config/dockerfile-generator/examples/example.dockerignore +95 -0
- package/skills/global_config/dockerfile-generator/examples/golang-distroless.Dockerfile +34 -0
- package/skills/global_config/dockerfile-generator/examples/java-springboot.Dockerfile +45 -0
- package/skills/global_config/dockerfile-generator/examples/nextjs-production.Dockerfile +49 -0
- package/skills/global_config/dockerfile-generator/examples/nodejs-multistage.Dockerfile +55 -0
- package/skills/global_config/dockerfile-generator/examples/python-fastapi.Dockerfile +48 -0
- package/skills/global_config/dockerfile-generator/references/language_specific_guides.md +510 -0
- package/skills/global_config/dockerfile-generator/references/multistage_builds.md +570 -0
- package/skills/global_config/dockerfile-generator/references/optimization_patterns.md +492 -0
- package/skills/global_config/dockerfile-generator/references/security_best_practices.md +375 -0
- package/skills/global_config/dockerfile-generator/scripts/generate_dockerignore.sh +199 -0
- package/skills/global_config/dockerfile-generator/scripts/generate_golang.sh +172 -0
- package/skills/global_config/dockerfile-generator/scripts/generate_java.sh +185 -0
- package/skills/global_config/dockerfile-generator/scripts/generate_nodejs.sh +279 -0
- package/skills/global_config/dockerfile-generator/scripts/generate_python.sh +218 -0
- package/skills/global_config/dockerfile-generator/scripts/test_generator.sh +210 -0
- package/skills/global_config/dockerfile-validator/SKILL.md +300 -0
- package/skills/global_config/dockerfile-validator/examples/.dockerignore.example +34 -0
- package/skills/global_config/dockerfile-validator/examples/bad-example.Dockerfile +37 -0
- package/skills/global_config/dockerfile-validator/examples/golang-distroless.Dockerfile +50 -0
- package/skills/global_config/dockerfile-validator/examples/good-example.Dockerfile +52 -0
- package/skills/global_config/dockerfile-validator/examples/python-optimized.Dockerfile +53 -0
- package/skills/global_config/dockerfile-validator/examples/security-issues.Dockerfile +42 -0
- package/skills/global_config/dockerfile-validator/references/docker_best_practices.md +348 -0
- package/skills/global_config/dockerfile-validator/references/optimization_guide.md +473 -0
- package/skills/global_config/dockerfile-validator/references/security_checklist.md +208 -0
- package/skills/global_config/dockerfile-validator/scripts/dockerfile-validate.sh +699 -0
- package/skills/global_config/dockerfile-validator/scripts/test_validate.sh +35 -0
- package/skills/global_config/dockerfile-validator/tests/fixtures/copy-before-yarn-lock-read.Dockerfile +6 -0
- package/skills/global_config/dockerfile-validator/tests/fixtures/copy-before-yarn.Dockerfile +6 -0
- package/skills/global_config/dockerfile-validator/tests/fixtures/from-platform-nonroot.Dockerfile +7 -0
- package/skills/global_config/dockerfile-validator/tests/test_regression.sh +164 -0
- package/skills/global_config/finishing-a-development-branch/SKILL.md +228 -0
- package/skills/global_config/github-actions-generator/SKILL.md +353 -0
- package/skills/global_config/github-actions-generator/assets/templates/action/composite/action.yml +82 -0
- package/skills/global_config/github-actions-generator/assets/templates/action/docker/Dockerfile +25 -0
- package/skills/global_config/github-actions-generator/assets/templates/action/docker/action.yml +42 -0
- package/skills/global_config/github-actions-generator/assets/templates/action/docker/entrypoint.sh +27 -0
- package/skills/global_config/github-actions-generator/assets/templates/action/javascript/action.yml +33 -0
- package/skills/global_config/github-actions-generator/assets/templates/action/javascript/index.js +50 -0
- package/skills/global_config/github-actions-generator/assets/templates/action/javascript/package.json +27 -0
- package/skills/global_config/github-actions-generator/assets/templates/workflow/basic_workflow.yml +242 -0
- package/skills/global_config/github-actions-generator/assets/templates/workflow/reusable_workflow.yml +106 -0
- package/skills/global_config/github-actions-generator/examples/README.md +147 -0
- package/skills/global_config/github-actions-generator/examples/actions/setup-node-cached/action.yml +93 -0
- package/skills/global_config/github-actions-generator/examples/caching/docker-buildkit.yml +256 -0
- package/skills/global_config/github-actions-generator/examples/security/dependency-review.yml +62 -0
- package/skills/global_config/github-actions-generator/examples/security/sbom-attestation.yml +119 -0
- package/skills/global_config/github-actions-generator/examples/triggers/chatops-commands.yml +475 -0
- package/skills/global_config/github-actions-generator/examples/triggers/repository-dispatch.yml +418 -0
- package/skills/global_config/github-actions-generator/examples/triggers/workflow-orchestration.yml +404 -0
- package/skills/global_config/github-actions-generator/examples/workflows/docker-build-push.yml +68 -0
- package/skills/global_config/github-actions-generator/examples/workflows/go-ci.yml +161 -0
- package/skills/global_config/github-actions-generator/examples/workflows/monorepo-ci.yml +340 -0
- package/skills/global_config/github-actions-generator/examples/workflows/multi-environment-deploy.yml +406 -0
- package/skills/global_config/github-actions-generator/examples/workflows/nodejs-ci.yml +122 -0
- package/skills/global_config/github-actions-generator/examples/workflows/python-ci.yml +157 -0
- package/skills/global_config/github-actions-generator/examples/workflows/scheduled-tasks.yml +376 -0
- package/skills/global_config/github-actions-generator/references/advanced-triggers.md +917 -0
- package/skills/global_config/github-actions-generator/references/best-practices.md +755 -0
- package/skills/global_config/github-actions-generator/references/common-actions.md +715 -0
- package/skills/global_config/github-actions-generator/references/custom-actions.md +320 -0
- package/skills/global_config/github-actions-generator/references/expressions-and-contexts.md +688 -0
- package/skills/global_config/github-actions-generator/references/modern-features.md +421 -0
- package/skills/global_config/github-actions-generator/scripts/test_generator.sh +344 -0
- package/skills/global_config/github-actions-templates/SKILL.md +7 -0
- package/skills/global_config/github-actions-validator/SKILL.md +576 -0
- package/skills/global_config/github-actions-validator/examples/README.md +88 -0
- package/skills/global_config/github-actions-validator/examples/outdated-versions.yml +76 -0
- package/skills/global_config/github-actions-validator/examples/valid-ci.yml +79 -0
- package/skills/global_config/github-actions-validator/examples/with-errors.yml +47 -0
- package/skills/global_config/github-actions-validator/references/act_usage.md +233 -0
- package/skills/global_config/github-actions-validator/references/action_versions.md +122 -0
- package/skills/global_config/github-actions-validator/references/actionlint_usage.md +343 -0
- package/skills/global_config/github-actions-validator/references/common_errors.md +512 -0
- package/skills/global_config/github-actions-validator/references/modern_features.md +384 -0
- package/skills/global_config/github-actions-validator/references/runners.md +317 -0
- package/skills/global_config/github-actions-validator/scripts/install_tools.sh +113 -0
- package/skills/global_config/github-actions-validator/scripts/validate_workflow.sh +910 -0
- package/skills/global_config/github-actions-validator/tests/test_validate_workflow.sh +237 -0
- package/skills/global_config/makefile-generator/SKILL.md +614 -0
- package/skills/global_config/makefile-generator/assets/templates/.gitkeep +1 -0
- package/skills/global_config/makefile-generator/docs/makefile-structure.md +530 -0
- package/skills/global_config/makefile-generator/docs/optimization-guide.md +784 -0
- package/skills/global_config/makefile-generator/docs/patterns-guide.md +642 -0
- package/skills/global_config/makefile-generator/docs/security-guide.md +361 -0
- package/skills/global_config/makefile-generator/docs/targets-guide.md +642 -0
- package/skills/global_config/makefile-generator/docs/variables-guide.md +596 -0
- package/skills/global_config/makefile-generator/scripts/add_standard_targets.sh +539 -0
- package/skills/global_config/makefile-generator/scripts/generate_makefile_template.sh +690 -0
- package/skills/global_config/makefile-generator/test/test_helper_scripts.sh +190 -0
- package/skills/global_config/makefile-validator/SKILL.md +244 -0
- package/skills/global_config/makefile-validator/docs/bake-tool.md +1000 -0
- package/skills/global_config/makefile-validator/docs/best-practices.md +858 -0
- package/skills/global_config/makefile-validator/docs/common-mistakes.md +944 -0
- package/skills/global_config/makefile-validator/examples/bad-makefile.mk +77 -0
- package/skills/global_config/makefile-validator/examples/good-makefile.mk +103 -0
- package/skills/global_config/makefile-validator/scripts/test_validate.sh +382 -0
- package/skills/global_config/makefile-validator/scripts/validate_makefile.sh +712 -0
- package/skills/global_config/{MCP_Manage → mcp-manage}/SKILL.md +3 -3
- package/skills/global_config/plan-canvas/SKILL.md +9 -2
- package/skills/global_config/plan-canvas/scripts/lib/plan-canvas/ui.js +10 -2
- package/skills/global_config/plan-canvas/scripts/plan-canvas.js +1 -1
- package/skills/global_config/read-the-damn-docs/SKILL.md +175 -0
- package/skills/global_config/requesting-code-review/SKILL.md +98 -0
- package/skills/global_config/requesting-code-review/code-reviewer.md +198 -0
- package/skills/global_config/using-git-worktrees/SKILL.md +170 -0
- package/skills/global_config/verification-before-completion/SKILL.md +123 -0
- package/skills/global_config/writing-plans/SKILL.md +126 -46
- package/skills/global_config/writing-plans-legacy/SKILL.md +152 -0
- package/.claude/CLAUDE.md +0 -12
- package/mcps/RhinoMCP/docs/content/docs/getting-started/gemini.md +0 -61
- /package/{GEMINI.md → RULES.md} +0 -0
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
# ChatOps Commands Example
|
|
2
|
+
# Demonstrates: issue_comment trigger, PR commands, permission validation, command parsing, feedback
|
|
3
|
+
|
|
4
|
+
name: ChatOps Commands
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
issue_comment:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
pull-requests: write
|
|
13
|
+
deployments: write
|
|
14
|
+
issues: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
# Command router - determines which command to run
|
|
18
|
+
parse-command:
|
|
19
|
+
name: Parse ChatOps Command
|
|
20
|
+
# Only run on PRs, not issues
|
|
21
|
+
if: github.event.issue.pull_request
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
timeout-minutes: 5
|
|
24
|
+
|
|
25
|
+
outputs:
|
|
26
|
+
command: ${{ steps.parse.outputs.command }}
|
|
27
|
+
args: ${{ steps.parse.outputs.args }}
|
|
28
|
+
is-authorized: ${{ steps.check-permissions.outputs.authorized }}
|
|
29
|
+
|
|
30
|
+
steps:
|
|
31
|
+
- name: Parse command
|
|
32
|
+
id: parse
|
|
33
|
+
env:
|
|
34
|
+
COMMENT_BODY: ${{ github.event.comment.body }}
|
|
35
|
+
run: |
|
|
36
|
+
COMMENT="$COMMENT_BODY"
|
|
37
|
+
|
|
38
|
+
# Extract command (first word starting with /)
|
|
39
|
+
COMMAND=$(echo "$COMMENT" | grep -oE '^/[-[:alnum:]_]+' | sed 's|^/||' || echo "")
|
|
40
|
+
|
|
41
|
+
# Extract arguments (everything after command)
|
|
42
|
+
ARGS=$(echo "$COMMENT" | sed -E 's|^/[-[:alnum:]_]+\s*||' || echo "")
|
|
43
|
+
|
|
44
|
+
echo "command=$COMMAND" >> $GITHUB_OUTPUT
|
|
45
|
+
echo "args=$ARGS" >> $GITHUB_OUTPUT
|
|
46
|
+
|
|
47
|
+
echo "Detected command: /$COMMAND"
|
|
48
|
+
echo "Arguments: $ARGS"
|
|
49
|
+
|
|
50
|
+
- name: Check permissions
|
|
51
|
+
id: check-permissions
|
|
52
|
+
env:
|
|
53
|
+
AUTHOR_ASSOCIATION: ${{ github.event.comment.author_association }}
|
|
54
|
+
COMMAND: ${{ steps.parse.outputs.command }}
|
|
55
|
+
run: |
|
|
56
|
+
# Define allowed associations per command
|
|
57
|
+
case "$COMMAND" in
|
|
58
|
+
deploy|approve|merge)
|
|
59
|
+
# Sensitive commands - only owners and members
|
|
60
|
+
ALLOWED="OWNER MEMBER"
|
|
61
|
+
;;
|
|
62
|
+
run-tests|benchmark|lint)
|
|
63
|
+
# Less sensitive - include collaborators
|
|
64
|
+
ALLOWED="OWNER MEMBER COLLABORATOR"
|
|
65
|
+
;;
|
|
66
|
+
help|status|info)
|
|
67
|
+
# Public commands - anyone
|
|
68
|
+
ALLOWED="OWNER MEMBER COLLABORATOR CONTRIBUTOR FIRST_TIME_CONTRIBUTOR FIRST_TIMER NONE"
|
|
69
|
+
;;
|
|
70
|
+
*)
|
|
71
|
+
# Unknown command - no one
|
|
72
|
+
ALLOWED=""
|
|
73
|
+
;;
|
|
74
|
+
esac
|
|
75
|
+
|
|
76
|
+
if echo "$ALLOWED" | grep -q "$AUTHOR_ASSOCIATION"; then
|
|
77
|
+
echo "authorized=true" >> $GITHUB_OUTPUT
|
|
78
|
+
echo "✅ User authorized: ${{ github.event.comment.user.login }} ($AUTHOR_ASSOCIATION)"
|
|
79
|
+
else
|
|
80
|
+
echo "authorized=false" >> $GITHUB_OUTPUT
|
|
81
|
+
echo "❌ User not authorized: ${{ github.event.comment.user.login }} ($AUTHOR_ASSOCIATION)"
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
- name: React to unauthorized command
|
|
85
|
+
if: steps.check-permissions.outputs.authorized == 'false'
|
|
86
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
87
|
+
with:
|
|
88
|
+
script: |
|
|
89
|
+
await github.rest.reactions.createForIssueComment({
|
|
90
|
+
owner: context.repo.owner,
|
|
91
|
+
repo: context.repo.repo,
|
|
92
|
+
comment_id: context.payload.comment.id,
|
|
93
|
+
content: '-1'
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
await github.rest.issues.createComment({
|
|
97
|
+
owner: context.repo.owner,
|
|
98
|
+
repo: context.repo.repo,
|
|
99
|
+
issue_number: context.payload.issue.number,
|
|
100
|
+
body: `❌ @${{ github.event.comment.user.login }} You don't have permission to run this command.\n\nRequired role: OWNER or MEMBER`
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
# Command: /deploy [environment]
|
|
104
|
+
cmd-deploy:
|
|
105
|
+
name: Deploy Command
|
|
106
|
+
needs: [parse-command]
|
|
107
|
+
if: |
|
|
108
|
+
needs.parse-command.outputs.command == 'deploy' &&
|
|
109
|
+
needs.parse-command.outputs.is-authorized == 'true'
|
|
110
|
+
runs-on: ubuntu-latest
|
|
111
|
+
timeout-minutes: 20
|
|
112
|
+
|
|
113
|
+
steps:
|
|
114
|
+
- name: React with rocket
|
|
115
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
116
|
+
with:
|
|
117
|
+
script: |
|
|
118
|
+
await github.rest.reactions.createForIssueComment({
|
|
119
|
+
owner: context.repo.owner,
|
|
120
|
+
repo: context.repo.repo,
|
|
121
|
+
comment_id: context.payload.comment.id,
|
|
122
|
+
content: 'rocket'
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
- name: Parse deploy arguments
|
|
126
|
+
id: parse-deploy
|
|
127
|
+
run: |
|
|
128
|
+
ARGS="${{ needs.parse-command.outputs.args }}"
|
|
129
|
+
|
|
130
|
+
# Extract environment (default: staging)
|
|
131
|
+
ENV=$(echo "$ARGS" | awk '{print $1}' | tr '[:upper:]' '[:lower:]')
|
|
132
|
+
ENV=${ENV:-staging}
|
|
133
|
+
|
|
134
|
+
# Validate environment
|
|
135
|
+
if [[ ! "$ENV" =~ ^(dev|staging|production)$ ]]; then
|
|
136
|
+
echo "error=Invalid environment: $ENV" >> $GITHUB_OUTPUT
|
|
137
|
+
exit 1
|
|
138
|
+
fi
|
|
139
|
+
|
|
140
|
+
echo "environment=$ENV" >> $GITHUB_OUTPUT
|
|
141
|
+
|
|
142
|
+
- name: Get PR details
|
|
143
|
+
id: pr
|
|
144
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
145
|
+
with:
|
|
146
|
+
result-encoding: string
|
|
147
|
+
script: |
|
|
148
|
+
const pr = await github.rest.pulls.get({
|
|
149
|
+
owner: context.repo.owner,
|
|
150
|
+
repo: context.repo.repo,
|
|
151
|
+
pull_number: context.payload.issue.number
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
core.setOutput('ref', pr.data.head.ref);
|
|
155
|
+
core.setOutput('sha', pr.data.head.sha);
|
|
156
|
+
core.setOutput('mergeable', pr.data.mergeable);
|
|
157
|
+
|
|
158
|
+
- name: Check if PR is mergeable
|
|
159
|
+
if: steps.pr.outputs.mergeable == 'false'
|
|
160
|
+
run: |
|
|
161
|
+
echo "❌ PR has merge conflicts"
|
|
162
|
+
exit 1
|
|
163
|
+
|
|
164
|
+
- name: Checkout PR code
|
|
165
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
166
|
+
with:
|
|
167
|
+
ref: ${{ steps.pr.outputs.ref }}
|
|
168
|
+
|
|
169
|
+
- name: Setup Node.js
|
|
170
|
+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
|
171
|
+
with:
|
|
172
|
+
node-version: '24'
|
|
173
|
+
cache: 'npm'
|
|
174
|
+
|
|
175
|
+
- name: Install and build
|
|
176
|
+
run: |
|
|
177
|
+
npm ci
|
|
178
|
+
npm run build
|
|
179
|
+
|
|
180
|
+
- name: Deploy to environment
|
|
181
|
+
id: deploy
|
|
182
|
+
env:
|
|
183
|
+
ENVIRONMENT: ${{ steps.parse-deploy.outputs.environment }}
|
|
184
|
+
run: |
|
|
185
|
+
echo "🚀 Deploying to $ENVIRONMENT"
|
|
186
|
+
|
|
187
|
+
# Deployment logic here
|
|
188
|
+
DEPLOY_URL="https://$ENVIRONMENT.example.com"
|
|
189
|
+
echo "url=$DEPLOY_URL" >> $GITHUB_OUTPUT
|
|
190
|
+
|
|
191
|
+
- name: Comment deployment success
|
|
192
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
193
|
+
with:
|
|
194
|
+
script: |
|
|
195
|
+
const environment = '${{ steps.parse-deploy.outputs.environment }}';
|
|
196
|
+
const url = '${{ steps.deploy.outputs.url }}';
|
|
197
|
+
|
|
198
|
+
await github.rest.issues.createComment({
|
|
199
|
+
owner: context.repo.owner,
|
|
200
|
+
repo: context.repo.repo,
|
|
201
|
+
issue_number: context.payload.issue.number,
|
|
202
|
+
body: `## ✅ Deployment Successful
|
|
203
|
+
|
|
204
|
+
**Environment:** ${environment}
|
|
205
|
+
**URL:** ${url}
|
|
206
|
+
**Triggered by:** @${{ github.event.comment.user.login }}
|
|
207
|
+
**Commit:** ${{ steps.pr.outputs.sha }}
|
|
208
|
+
|
|
209
|
+
[View workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
210
|
+
`
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
- name: Comment deployment failure
|
|
214
|
+
if: failure()
|
|
215
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
216
|
+
with:
|
|
217
|
+
script: |
|
|
218
|
+
await github.rest.issues.createComment({
|
|
219
|
+
owner: context.repo.owner,
|
|
220
|
+
repo: context.repo.repo,
|
|
221
|
+
issue_number: context.payload.issue.number,
|
|
222
|
+
body: `## ❌ Deployment Failed
|
|
223
|
+
|
|
224
|
+
[View workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
225
|
+
`
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
# Command: /run-tests [suite]
|
|
229
|
+
cmd-run-tests:
|
|
230
|
+
name: Run Tests Command
|
|
231
|
+
needs: [parse-command]
|
|
232
|
+
if: |
|
|
233
|
+
needs.parse-command.outputs.command == 'run-tests' &&
|
|
234
|
+
needs.parse-command.outputs.is-authorized == 'true'
|
|
235
|
+
runs-on: ubuntu-latest
|
|
236
|
+
timeout-minutes: 15
|
|
237
|
+
|
|
238
|
+
steps:
|
|
239
|
+
- name: React with eyes
|
|
240
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
241
|
+
with:
|
|
242
|
+
script: |
|
|
243
|
+
await github.rest.reactions.createForIssueComment({
|
|
244
|
+
owner: context.repo.owner,
|
|
245
|
+
repo: context.repo.repo,
|
|
246
|
+
comment_id: context.payload.comment.id,
|
|
247
|
+
content: 'eyes'
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
- name: Parse test suite
|
|
251
|
+
id: parse-suite
|
|
252
|
+
run: |
|
|
253
|
+
ARGS="${{ needs.parse-command.outputs.args }}"
|
|
254
|
+
SUITE=$(echo "$ARGS" | awk '{print $1}')
|
|
255
|
+
SUITE=${SUITE:-all}
|
|
256
|
+
|
|
257
|
+
echo "suite=$SUITE" >> $GITHUB_OUTPUT
|
|
258
|
+
|
|
259
|
+
- name: Get PR details
|
|
260
|
+
id: pr
|
|
261
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
262
|
+
with:
|
|
263
|
+
script: |
|
|
264
|
+
const pr = await github.rest.pulls.get({
|
|
265
|
+
owner: context.repo.owner,
|
|
266
|
+
repo: context.repo.repo,
|
|
267
|
+
pull_number: context.payload.issue.number
|
|
268
|
+
});
|
|
269
|
+
core.setOutput('ref', pr.data.head.ref);
|
|
270
|
+
|
|
271
|
+
- name: Checkout PR code
|
|
272
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
273
|
+
with:
|
|
274
|
+
ref: ${{ steps.pr.outputs.ref }}
|
|
275
|
+
|
|
276
|
+
- name: Setup Node.js
|
|
277
|
+
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
|
278
|
+
with:
|
|
279
|
+
node-version: '24'
|
|
280
|
+
cache: 'npm'
|
|
281
|
+
|
|
282
|
+
- name: Install dependencies
|
|
283
|
+
run: npm ci
|
|
284
|
+
|
|
285
|
+
- name: Run tests
|
|
286
|
+
id: test
|
|
287
|
+
env:
|
|
288
|
+
TEST_SUITE: ${{ steps.parse-suite.outputs.suite }}
|
|
289
|
+
run: |
|
|
290
|
+
echo "🧪 Running test suite: $TEST_SUITE"
|
|
291
|
+
|
|
292
|
+
case "$TEST_SUITE" in
|
|
293
|
+
unit)
|
|
294
|
+
npm run test:unit
|
|
295
|
+
;;
|
|
296
|
+
integration)
|
|
297
|
+
npm run test:integration
|
|
298
|
+
;;
|
|
299
|
+
e2e)
|
|
300
|
+
npm run test:e2e
|
|
301
|
+
;;
|
|
302
|
+
all)
|
|
303
|
+
npm test
|
|
304
|
+
;;
|
|
305
|
+
*)
|
|
306
|
+
echo "❌ Unknown test suite: $TEST_SUITE"
|
|
307
|
+
exit 1
|
|
308
|
+
;;
|
|
309
|
+
esac
|
|
310
|
+
|
|
311
|
+
- name: Comment test results
|
|
312
|
+
if: always()
|
|
313
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
314
|
+
with:
|
|
315
|
+
script: |
|
|
316
|
+
const suite = '${{ steps.parse-suite.outputs.suite }}';
|
|
317
|
+
const success = '${{ steps.test.outcome }}' === 'success';
|
|
318
|
+
const emoji = success ? '✅' : '❌';
|
|
319
|
+
const status = success ? 'Passed' : 'Failed';
|
|
320
|
+
|
|
321
|
+
await github.rest.issues.createComment({
|
|
322
|
+
owner: context.repo.owner,
|
|
323
|
+
repo: context.repo.repo,
|
|
324
|
+
issue_number: context.payload.issue.number,
|
|
325
|
+
body: `## ${emoji} Test Suite: ${suite} - ${status}
|
|
326
|
+
|
|
327
|
+
[View test results](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
328
|
+
`
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
# Command: /benchmark
|
|
332
|
+
cmd-benchmark:
|
|
333
|
+
name: Benchmark Command
|
|
334
|
+
needs: [parse-command]
|
|
335
|
+
if: |
|
|
336
|
+
needs.parse-command.outputs.command == 'benchmark' &&
|
|
337
|
+
needs.parse-command.outputs.is-authorized == 'true'
|
|
338
|
+
runs-on: ubuntu-latest
|
|
339
|
+
timeout-minutes: 30
|
|
340
|
+
|
|
341
|
+
steps:
|
|
342
|
+
- name: React with chart
|
|
343
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
344
|
+
with:
|
|
345
|
+
script: |
|
|
346
|
+
await github.rest.reactions.createForIssueComment({
|
|
347
|
+
owner: context.repo.owner,
|
|
348
|
+
repo: context.repo.repo,
|
|
349
|
+
comment_id: context.payload.comment.id,
|
|
350
|
+
content: '+1'
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
- name: Get PR details
|
|
354
|
+
id: pr
|
|
355
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
356
|
+
with:
|
|
357
|
+
script: |
|
|
358
|
+
const pr = await github.rest.pulls.get({
|
|
359
|
+
owner: context.repo.owner,
|
|
360
|
+
repo: context.repo.repo,
|
|
361
|
+
pull_number: context.payload.issue.number
|
|
362
|
+
});
|
|
363
|
+
core.setOutput('ref', pr.data.head.ref);
|
|
364
|
+
|
|
365
|
+
- name: Checkout PR code
|
|
366
|
+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
367
|
+
with:
|
|
368
|
+
ref: ${{ steps.pr.outputs.ref }}
|
|
369
|
+
|
|
370
|
+
- name: Run benchmarks
|
|
371
|
+
run: |
|
|
372
|
+
echo "⚡ Running performance benchmarks"
|
|
373
|
+
# Benchmark logic here
|
|
374
|
+
|
|
375
|
+
- name: Comment benchmark results
|
|
376
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
377
|
+
with:
|
|
378
|
+
script: |
|
|
379
|
+
await github.rest.issues.createComment({
|
|
380
|
+
owner: context.repo.owner,
|
|
381
|
+
repo: context.repo.repo,
|
|
382
|
+
issue_number: context.payload.issue.number,
|
|
383
|
+
body: `## ⚡ Benchmark Results
|
|
384
|
+
|
|
385
|
+
| Metric | Value | Baseline | Change |
|
|
386
|
+
|--------|-------|----------|--------|
|
|
387
|
+
| Response Time | 125ms | 130ms | -3.8% 🟢 |
|
|
388
|
+
| Throughput | 1,250 req/s | 1,200 req/s | +4.2% 🟢 |
|
|
389
|
+
| Memory Usage | 245 MB | 250 MB | -2.0% 🟢 |
|
|
390
|
+
|
|
391
|
+
✅ All metrics within acceptable range
|
|
392
|
+
|
|
393
|
+
[View details](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})
|
|
394
|
+
`
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
# Command: /help
|
|
398
|
+
cmd-help:
|
|
399
|
+
name: Help Command
|
|
400
|
+
needs: [parse-command]
|
|
401
|
+
if: needs.parse-command.outputs.command == 'help'
|
|
402
|
+
runs-on: ubuntu-latest
|
|
403
|
+
timeout-minutes: 5
|
|
404
|
+
|
|
405
|
+
steps:
|
|
406
|
+
- name: Show help
|
|
407
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
408
|
+
with:
|
|
409
|
+
script: |
|
|
410
|
+
await github.rest.issues.createComment({
|
|
411
|
+
owner: context.repo.owner,
|
|
412
|
+
repo: context.repo.repo,
|
|
413
|
+
issue_number: context.payload.issue.number,
|
|
414
|
+
body: `## 🤖 ChatOps Commands
|
|
415
|
+
|
|
416
|
+
Available commands:
|
|
417
|
+
|
|
418
|
+
### Deployment
|
|
419
|
+
- \`/deploy [env]\` - Deploy PR to environment (dev, staging, production)
|
|
420
|
+
- Example: \`/deploy staging\`
|
|
421
|
+
- Requires: OWNER or MEMBER permission
|
|
422
|
+
|
|
423
|
+
### Testing
|
|
424
|
+
- \`/run-tests [suite]\` - Run test suite (unit, integration, e2e, all)
|
|
425
|
+
- Example: \`/run-tests unit\`
|
|
426
|
+
- Requires: OWNER, MEMBER, or COLLABORATOR permission
|
|
427
|
+
|
|
428
|
+
### Performance
|
|
429
|
+
- \`/benchmark\` - Run performance benchmarks
|
|
430
|
+
- Requires: OWNER, MEMBER, or COLLABORATOR permission
|
|
431
|
+
|
|
432
|
+
### Utility
|
|
433
|
+
- \`/help\` - Show this help message
|
|
434
|
+
- Available to everyone
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
**Your permission level:** ${{ github.event.comment.author_association }}
|
|
439
|
+
`
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
# Unknown command handler
|
|
443
|
+
cmd-unknown:
|
|
444
|
+
name: Unknown Command
|
|
445
|
+
needs: [parse-command]
|
|
446
|
+
if: |
|
|
447
|
+
needs.parse-command.outputs.command != '' &&
|
|
448
|
+
needs.parse-command.outputs.command != 'deploy' &&
|
|
449
|
+
needs.parse-command.outputs.command != 'run-tests' &&
|
|
450
|
+
needs.parse-command.outputs.command != 'benchmark' &&
|
|
451
|
+
needs.parse-command.outputs.command != 'help'
|
|
452
|
+
runs-on: ubuntu-latest
|
|
453
|
+
timeout-minutes: 5
|
|
454
|
+
|
|
455
|
+
steps:
|
|
456
|
+
- name: React with confused
|
|
457
|
+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
458
|
+
with:
|
|
459
|
+
script: |
|
|
460
|
+
await github.rest.reactions.createForIssueComment({
|
|
461
|
+
owner: context.repo.owner,
|
|
462
|
+
repo: context.repo.repo,
|
|
463
|
+
comment_id: context.payload.comment.id,
|
|
464
|
+
content: 'confused'
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
await github.rest.issues.createComment({
|
|
468
|
+
owner: context.repo.owner,
|
|
469
|
+
repo: context.repo.repo,
|
|
470
|
+
issue_number: context.payload.issue.number,
|
|
471
|
+
body: `❓ Unknown command: \`/${{ needs.parse-command.outputs.command }}\`
|
|
472
|
+
|
|
473
|
+
Type \`/help\` to see available commands.
|
|
474
|
+
`
|
|
475
|
+
});
|