Skip to content

chore(sync): [skip actions] synced file(s) with jbcom/control-center#14

Open
jbdevprimary wants to merge 1 commit into
mainfrom
repo-sync/control-center/default
Open

chore(sync): [skip actions] synced file(s) with jbcom/control-center#14
jbdevprimary wants to merge 1 commit into
mainfrom
repo-sync/control-center/default

Conversation

@jbdevprimary
Copy link
Copy Markdown
Contributor

@jbdevprimary jbdevprimary commented Jan 8, 2026

synced local file(s) with jbcom/control-center.

Changed files
  • synced local directory .github/ with remote directory sync-files/always-sync/global/.github/

This PR was created automatically by the repo-file-sync-action workflow run #20807422644

@jbdevprimary jbdevprimary self-assigned this Jan 8, 2026
@jbdevprimary jbdevprimary force-pushed the repo-sync/control-center/default branch from bfb8e3f to 7a8a2a4 Compare January 8, 2026 05:51
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@jbdevprimary jbdevprimary force-pushed the repo-sync/control-center/default branch 3 times, most recently from b062c99 to 57f32e1 Compare January 8, 2026 05:51
@jbdevprimary
Copy link
Copy Markdown
Contributor Author

🤖 AI Code Review

Summary

Adds 4 new GitHub Actions workflows (autoheal, delegator, review, triage) that automate CI failure resolution, command delegation, PR reviews, and repository health management using AI tools.

Issues Found

🔴 Security: Exposing OLLAMA_API_KEY and ANTHROPIC_API_KEY in workflow logs via run steps without proper masking

🔴 Security: Using docker run with host workspace volume mount poses container escape risks

🟠 Performance: Running rebase operations on ALL open PRs on every main push could overwhelm CI resources

🟠 Reliability: No rate limiting or error handling for GitHub API calls could trigger abuse detection

🟡 Maintainability: Hardcoded Docker image tags (jbcom/control-center:latest) without version pinning

🟡 Security: Broad contents: write permission may be excessive for some operations

Suggestions

  1. Use add-mask action for sensitive tokens before using them in run steps
  2. Pin Docker image versions and use GitHub Container Registry for security scanning
  3. Add concurrency controls to prevent multiple rebase operations simultaneously
  4. Implement retry logic with exponential backoff for GitHub API calls
  5. Scope down permissions per job (e.g., pull-requests: write only where needed)
  6. Add input validation for workflow_dispatch parameters to prevent injection
  7. Consider using GitHub-hosted runners' built-in container options instead of docker run
  8. Add workflow-level timeout to prevent runaway operations

Reviewed by Ecosystem Reviewer using glm-4.6:cloud

@jbdevprimary
Copy link
Copy Markdown
Contributor Author

🤖 AI Code Review

Summary

Adds 4 new GitHub Actions workflows (autoheal, delegator, review, triage) that automate CI failure resolution, PR reviews, issue triage, and conflict resolution using AI/LLM integration. Consolidates multiple existing workflows into a unified "control-center" system.

Issues Found

🔴 Security: Exposes OLLAMA_API_KEY and ANTHROPIC_API_KEY in workflow logs via run steps without proper masking
🔴 Security: Docker images from jbcom/control-center:latest run without pinning to specific digest
🟠 Performance: Auto-rebase on every main branch push could overwhelm CI with parallel jobs
🟠 Reliability: No error handling for Docker command failures
🟡 Access: Broad contents: write permission may be excessive for review-only operations

Suggestions

  1. Pin Docker images to SHA256 digests for supply chain security
  2. Use add-mask for sensitive API keys before logging
  3. Add rate limiting/queue mechanism for mass PR rebases
  4. Implement retry logic for Docker operations
  5. Scope down permissions per job (e.g., review only needs pull-requests: write)
  6. Add workflow-level timeout to prevent runaway jobs
  7. Consider using GitHub Actions cache for control-center image to reduce pull time

Reviewed by Ecosystem Reviewer using glm-4.6:cloud

@jbdevprimary
Copy link
Copy Markdown
Contributor Author

🤖 AI Code Review

Summary

New GitHub workflows for automated repository management:

  • autoheal.yml: AI-powered CI failure resolution and merge conflict handling
  • delegator.yml: Routes @claude commands from comments/issues
  • review.yml: Automated PR reviews using AI
  • triage.yml: Comprehensive issue/PR triage with automatic rebasing on main push

Issues Found

🔴 Security: Exposed secrets in workflow logs

  • OLLAMA_API_KEY and ANTHROPIC_API_KEY printed to logs via docker run commands
  • Should use add-mask or pass via stdin

🔴 Security: Overly broad permissions

  • actions: write in triage.yml is excessive for needed operations
  • contents: write in review.yml seems unnecessary (only reads content)

🟠 Reliability: Missing error handling

  • Docker commands lack proper error checking
  • No timeout handling for long-running operations

🟠 Performance: Potential resource waste

  • Rebase-all-PRs job runs on every main push without limits
  • Could overwhelm CI with many concurrent rebases

🟡 Maintainability: Hardcoded container references

  • jbcom/control-center:latest tag could cause unpredictable behavior
  • Should use specific version tags

🟡 Logic: Race condition in rebase-all-PRs

  • Multiple PR rebases running simultaneously could conflict
  • Missing concurrency controls

Suggestions

  1. Add secret masking:
- name: Mask secrets
  run: |
    echo "::add-mask::${{ secrets.OLLAMA_API_KEY }}"
    echo "::add-mask::${{ secrets.ANTHROPIC_API_KEY }}"
  1. Pin container versions:
jbcom/control-center:v1.2.3  # instead of :latest
  1. Add concurrency control:
concurrency:
  group: rebase-prs-${{ github.ref }}
  cancel-in-progress: true
  1. Reduce permissions to minimum required:
  • review.yml: contents: read (already correct)
  • triage.yml: Remove actions: write
  1. Add retry logic for docker operations with exponential backoff

  2. Consider rate limiting for PR rebases (e.g., max 5 concurrent)


Reviewed by Ecosystem Reviewer using glm-4.6:cloud

@jbdevprimary
Copy link
Copy Markdown
Contributor Author

jbdevprimary commented Jan 8, 2026

Claude finished @jbdevprimary's task in 1m 39s —— View job


Independent Code Review Complete

I've conducted a thorough analysis of the four new workflow files. Here are my findings:


Summary

This PR introduces a consolidated control-center workflow system with 4 components:

  • autoheal.yml: AI-powered CI failure analysis and merge conflict resolution
  • delegator.yml: Routes @claude commands from comments/issues
  • review.yml: Automated PR reviews using AI
  • triage.yml: Comprehensive repository health management including automatic PR rebasing

Critical Issues Found

🔴 Security: Secrets Exposed in Logs

Location: Multiple workflows

The API keys are passed as environment variables to docker commands, which can expose them in workflow logs:

  • autoheal.yml:81-82 - OLLAMA_API_KEY passed to docker run
  • autoheal.yml:91-92 - Same issue
  • delegator.yml:78 - ANTHROPIC_API_KEY in env (though not actually used in run step)
  • review.yml:50 - OLLAMA_API_KEY passed to docker run
  • review.yml:63 - Same issue

Impact: API keys could be visible in workflow logs if docker outputs environment info or errors occur.

Recommendation: Use GitHub's add-mask command before using secrets:

- name: Mask secrets
  run: |
    echo "::add-mask::${{ secrets.OLLAMA_API_KEY }}"
    echo "::add-mask::${{ secrets.ANTHROPIC_API_KEY }}"

Fix this →

🔴 Security: Unrestricted Container Volume Mount

Location: autoheal.yml:98, triage.yml:294

-v "${{ github.workspace }}:/workspace"

Impact: Mounts entire workspace with full read/write access, creating potential container escape risks. Container could modify arbitrary files including .git directory.

Recommendation: Use read-only mounts where possible (-v "${{ github.workspace }}:/workspace:ro") or mount only specific subdirectories needed.

Fix this →

🔴 Security: Unpinned Docker Image Tags

Location: All workflows use jbcom/control-center:latest

Impact: Using :latest tag means workflow behavior can change unpredictably when image updates. Supply chain attacks could inject malicious code.

Recommendation: Pin to specific version or SHA256 digest:

jbcom/control-center:v1.2.3
# or
jbcom/control-center@sha256:abc123...

Fix this →


High Priority Issues

🟠 Performance: Mass PR Rebase on Every Main Push

Location: triage.yml:47-187

The rebase-prs-on-main-push job runs on every push to main and processes all open PRs sequentially without any concurrency controls or rate limiting.

Impact:

  • With 20+ open PRs, this could overwhelm GitHub API rate limits
  • Long-running workflow could delay other CI jobs
  • Sequential processing means very slow execution

Recommendation:

  1. Add concurrency control:
concurrency:
  group: rebase-prs-${{ github.repository }}
  cancel-in-progress: true
  1. Batch process PRs (e.g., max 10 per run)
  2. Add workflow timeout: timeout-minutes: 30

Fix this →

🟠 Reliability: No Error Handling for Docker Commands

Location: All docker run commands throughout workflows

Impact: If docker commands fail (network issues, image pull failures, API errors), the workflow continues silently or fails without proper diagnostics.

Recommendation: Add error checking:

- name: Example with error handling
  run: |
    if ! docker run --rm ... ; then
      echo "::error::Docker command failed"
      exit 1
    fi

Or use set -e at the start of multi-line run blocks.

🟠 Reliability: Missing GitHub API Rate Limit Handling

Location: triage.yml:69-184 - Loop processing all PRs

Impact: With many PRs, this could hit GitHub API rate limits (5000 requests/hour), causing failures.

Recommendation:

  1. Add rate limit checking before loops
  2. Implement exponential backoff retry logic
  3. Add delays between PR operations

Medium Priority Issues

🟡 Logic: Overly Broad Permissions

Location: Multiple workflows

  • autoheal.yml:57-60 - Has actions: read but may not need it
  • triage.yml:38-41 - Has actions: write which is very broad and may be excessive
  • review.yml:33-36 - Has issues: write but only creates comments (may not need full write access)

Recommendation: Use principle of least privilege. Review if actions: write is actually needed.

🟡 Maintainability: Delegator Workflow is Incomplete

Location: delegator.yml:73-75

# In a real implementation, this would call Claude API
# or control-center with Claude integration
echo "Command execution delegated to Claude agent"

Impact: The workflow acknowledges commands but doesn't actually execute them.

Recommendation: Either implement the functionality or remove the workflow until ready.

🟡 Logic: Potential Race Condition

Location: triage.yml:127-130

When conflicts are detected, the workflow triggers autoheal asynchronously via gh workflow run, then immediately comments on the PR. Multiple concurrent rebase operations could conflict.

Recommendation: Add workflow concurrency controls per-PR:

concurrency:
  group: pr-${{ github.event.pull_request.number }}
  cancel-in-progress: false

🟡 Maintainability: Hardcoded Branch Names

Location: triage.yml:14-15

- main
- master

Recommendation: Use github.event.repository.default_branch dynamically, or make this configurable.


Minor Issues

🟢 Code Quality: Inconsistent jq Usage

Location: triage.yml:60

echo "count=$(jq length open-prs.json)" >> $GITHUB_OUTPUT

Missing -r flag and file input. Should be:

echo "count=$(jq -r 'length' open-prs.json)" >> $GITHUB_OUTPUT

🟢 Reliability: Missing File Existence Checks

Location: autoheal.yml:113, review.yml:70

Reading JSON files without checking if they exist first could cause failures.

Recommendation:

if (!fs.existsSync('review-result.json')) {
  console.log('Review file not found');
  return;
}

Positive Aspects

✅ Good use of SHA-pinned GitHub Actions (actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8)
✅ Comprehensive workflow consolidation reducing duplication
✅ Intelligent enterprise health management concept is valuable
✅ Good use of workflow summaries ($GITHUB_STEP_SUMMARY)
✅ Proper use of workflow_call for reusability


Summary of Recommendations

Must Fix (Security):

  1. Add secret masking for API keys
  2. Pin Docker image versions
  3. Use read-only volume mounts where possible

Should Fix (Reliability/Performance):
4. Add concurrency controls to prevent parallel rebase conflicts
5. Implement rate limiting and error handling
6. Add workflow timeouts
7. Add retry logic for Docker/API operations

Consider (Maintainability):
8. Reduce overly broad permissions
9. Complete or remove delegator implementation
10. Fix jq syntax issues


Note on Workflow Modifications

⚠️ Important: I cannot directly modify files in the .github/workflows directory due to GitHub App permissions. To implement these fixes, you'll need to either:

  • Apply the changes manually
  • Use a different branch/approach for workflow modifications
  • Grant additional permissions to the automation

The "Fix this →" links above will open Claude Code with context to help implement each fix.


Tasks

  • Read and analyze autoheal.yml
  • Read and analyze delegator.yml
  • Read and analyze review.yml
  • Read and analyze triage.yml
  • Compile comprehensive code review feedback
  • Post final review

- name: Execute command
if: steps.parse.outputs.command != ''
run: |
echo "Delegating command: ${{ steps.parse.outputs.command }}"

Check failure

Code scanning / CodeQL

Code injection Critical

Potential code injection in
${ steps.parse.outputs.command }
, which may be controlled by an external user (
issue_comment
).

Copilot Autofix

AI 5 months ago

To fix the issue, we should avoid inserting the untrusted steps.parse.outputs.command directly into the run: body via ${{ ... }}. Instead, we follow GitHub’s recommended pattern: assign the untrusted data to an environment variable via workflow expressions, and then reference it inside the script using native shell variable expansion (e.g., $COMMAND), not ${{ env.COMMAND }}.

Concretely, in .github/workflows/delegator.yml, within the Execute command step (lines 67–79), we will:

  • Add COMMAND and ISSUE_NUMBER to the env: block, setting them from ${{ steps.parse.outputs.command }} and ${{ steps.parse.outputs.issue_number }} respectively.
  • Update the run: script to use "$COMMAND" and "$ISSUE_NUMBER" instead of ${{ steps.parse.outputs.command }} and ${{ steps.parse.outputs.issue_number }}.

This keeps functionality identical (still just logging the command and issue/PR) while removing the direct use of untrusted data in the expression context inside run:. No new imports or external dependencies are needed.

Suggested changeset 1
.github/workflows/delegator.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/delegator.yml b/.github/workflows/delegator.yml
--- a/.github/workflows/delegator.yml
+++ b/.github/workflows/delegator.yml
@@ -66,16 +66,18 @@
 
       - name: Execute command
         if: steps.parse.outputs.command != ''
+        env:
+          COMMAND: ${{ steps.parse.outputs.command }}
+          ISSUE_NUMBER: ${{ steps.parse.outputs.issue_number }}
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
         run: |
-          echo "Delegating command: ${{ steps.parse.outputs.command }}"
-          echo "Issue/PR: ${{ steps.parse.outputs.issue_number }}"
+          echo "Delegating command: $COMMAND"
+          echo "Issue/PR: $ISSUE_NUMBER"
           
           # In a real implementation, this would call Claude API
           # or control-center with Claude integration
           echo "Command execution delegated to Claude agent"
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
 
       - name: Acknowledge command
         if: steps.parse.outputs.command != ''
EOF
@@ -66,16 +66,18 @@

- name: Execute command
if: steps.parse.outputs.command != ''
env:
COMMAND: ${{ steps.parse.outputs.command }}
ISSUE_NUMBER: ${{ steps.parse.outputs.issue_number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
echo "Delegating command: ${{ steps.parse.outputs.command }}"
echo "Issue/PR: ${{ steps.parse.outputs.issue_number }}"
echo "Delegating command: $COMMAND"
echo "Issue/PR: $ISSUE_NUMBER"

# In a real implementation, this would call Claude API
# or control-center with Claude integration
echo "Command execution delegated to Claude agent"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

- name: Acknowledge command
if: steps.parse.outputs.command != ''
Copilot is powered by AI and may make mistakes. Always verify output.
@jbdevprimary
Copy link
Copy Markdown
Contributor Author

📦 Tracking: #15

@amazon-q-developer
Copy link
Copy Markdown

⚠️ Review Failed

I was unable to finalize my review because the pull request head or merge base was modified since I began my review. Please try again.

Request ID: d2e88ba4-70f6-51a3-9d5b-ea7d38e56b38

…-files/always-sync/global/.github/'

Synced from jbcom/control-center

Run: https://github.com/jbcom/control-center/actions/runs/20807422644

[skip actions]
@jbdevprimary jbdevprimary changed the title chore(sync): synced file(s) with jbcom/control-center chore(sync): [skip actions] synced file(s) with jbcom/control-center Jan 8, 2026
@jbdevprimary jbdevprimary force-pushed the repo-sync/control-center/default branch from 57f32e1 to 82e5671 Compare January 8, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants