mirror of
https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite.git
synced 2026-02-11 23:26:36 +00:00
Compare commits
13 Commits
test/chack
...
chack-test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3105e6622 | ||
|
|
fbbf31f020 | ||
|
|
0680509774 | ||
|
|
3b0a8fd616 | ||
|
|
62ef61af0f | ||
|
|
b6c4474c27 | ||
|
|
4650d6b8ad | ||
|
|
354e3b81fb | ||
|
|
2848feda9b | ||
|
|
0bec3535dc | ||
|
|
2b1ab21f66 | ||
|
|
a8c5967d21 | ||
|
|
1e68040be3 |
20
.github/workflows/chack-agent-pr-triage.yml
vendored
20
.github/workflows/chack-agent-pr-triage.yml
vendored
@@ -12,6 +12,8 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
env:
|
||||
CHACK_LOGS_HTTP_URL: ${{ secrets.CHACK_LOGS_HTTP_URL }}
|
||||
outputs:
|
||||
should_run: ${{ steps.gate.outputs.should_run }}
|
||||
pr_number: ${{ steps.gate.outputs.pr_number }}
|
||||
@@ -86,7 +88,7 @@ jobs:
|
||||
uses: carlospolop/chack-agent@master
|
||||
with:
|
||||
provider: openrouter
|
||||
model_primary: BEST_QUALITY
|
||||
model_primary: CHEAP_BUT_QUALITY
|
||||
main_action: peass-ng
|
||||
sub_action: Chack-Agent PR Triage
|
||||
system_prompt: |
|
||||
@@ -96,6 +98,7 @@ jobs:
|
||||
Remember taht you are an autonomouts agent, use the exec tool to run the needed commands to list, read, analyze, modify, test...
|
||||
tools_config_json: "{\"exec_enabled\": true}"
|
||||
session_config_json: "{\"long_term_memory_enabled\": false}"
|
||||
agent_config_json: "{\"self_critique_enabled\": false, \"require_task_list_init_first\": true}"
|
||||
output_schema_file: .github/chack-agent/pr-merge-schema.json
|
||||
user_prompt: |
|
||||
You are reviewing PR #${{ steps.gate.outputs.pr_number }} for ${{ github.repository }}.
|
||||
@@ -131,9 +134,18 @@ jobs:
|
||||
import json
|
||||
import os
|
||||
|
||||
data = json.loads(os.environ.get('CHACK_MESSAGE', '') or '{}')
|
||||
decision = data.get('decision', 'comment')
|
||||
message = data.get('message', '').strip() or 'Chack Agent did not provide details.'
|
||||
raw = (os.environ.get('CHACK_MESSAGE', '') or '').strip()
|
||||
decision = 'comment'
|
||||
message = 'Chack Agent did not provide details.'
|
||||
try:
|
||||
data = json.loads(raw or '{}')
|
||||
if isinstance(data, dict):
|
||||
decision = data.get('decision', 'comment')
|
||||
message = data.get('message', '').strip() or message
|
||||
else:
|
||||
message = raw or message
|
||||
except Exception:
|
||||
message = raw or message
|
||||
with open(os.environ['GITHUB_OUTPUT'], 'a') as handle:
|
||||
handle.write(f"decision={decision}\n")
|
||||
handle.write("message<<EOF\n")
|
||||
|
||||
@@ -20,6 +20,7 @@ jobs:
|
||||
env:
|
||||
TARGET_BRANCH: master
|
||||
FIX_BRANCH: chack-agent/ci-master-fix-${{ github.event.workflow_run.id }}
|
||||
CHACK_LOGS_HTTP_URL: ${{ secrets.CHACK_LOGS_HTTP_URL }}
|
||||
steps:
|
||||
- name: Checkout failing commit
|
||||
uses: actions/checkout@v5
|
||||
@@ -101,7 +102,7 @@ jobs:
|
||||
uses: carlospolop/chack-agent@master
|
||||
with:
|
||||
provider: openrouter
|
||||
model_primary: BEST_QUALITY
|
||||
model_primary: CHEAP_BUT_QUALITY
|
||||
main_action: peass-ng
|
||||
sub_action: CI-master Failure Chack-Agent PR
|
||||
system_prompt: |
|
||||
@@ -110,6 +111,7 @@ jobs:
|
||||
prompt_file: chack_prompt.txt
|
||||
tools_config_json: "{\"exec_enabled\": true}"
|
||||
session_config_json: "{\"long_term_memory_enabled\": false}"
|
||||
agent_config_json: "{\"self_critique_enabled\": false, \"require_task_list_init_first\": true}"
|
||||
openrouter_api_key: ${{ secrets.OPENROUTER_API_KEY }}
|
||||
|
||||
- name: Commit and push fix branch if changed
|
||||
@@ -123,9 +125,27 @@ jobs:
|
||||
|
||||
rm -f chack_failure_summary.txt chack_prompt.txt chack_failed_steps_logs.txt
|
||||
git add -A
|
||||
# Avoid workflow-file pushes with token scopes that cannot write workflows.
|
||||
git reset -- .github/workflows || true
|
||||
git checkout -- .github/workflows || true
|
||||
git clean -fdx -- .github/workflows || true
|
||||
git reset -- chack_failure_summary.txt chack_prompt.txt chack_failed_steps_logs.txt
|
||||
if git diff --cached --name-only | grep -q '^.github/workflows/'; then
|
||||
echo "Workflow-file changes are still staged; skipping push without workflows permission."
|
||||
echo "pushed=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
if git diff --cached --quiet; then
|
||||
echo "No committable changes left after filtering."
|
||||
echo "pushed=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
git commit -m "Fix CI-master failures for run #${{ github.event.workflow_run.id }}"
|
||||
git push origin HEAD:"$FIX_BRANCH"
|
||||
if ! git push origin HEAD:"$FIX_BRANCH"; then
|
||||
echo "Push failed (likely token workflow permission limits); skipping PR creation."
|
||||
echo "pushed=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
echo "pushed=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create PR to master
|
||||
|
||||
@@ -64,6 +64,8 @@ jobs:
|
||||
pull-requests: write
|
||||
issues: write
|
||||
actions: read
|
||||
env:
|
||||
CHACK_LOGS_HTTP_URL: ${{ secrets.CHACK_LOGS_HTTP_URL }}
|
||||
steps:
|
||||
- name: Comment on PR with failure info
|
||||
uses: actions/github-script@v7
|
||||
@@ -157,7 +159,7 @@ jobs:
|
||||
uses: carlospolop/chack-agent@master
|
||||
with:
|
||||
provider: openrouter
|
||||
model_primary: BEST_QUALITY
|
||||
model_primary: CHEAP_BUT_QUALITY
|
||||
main_action: peass-ng
|
||||
sub_action: PR Failure Chack-Agent Dispatch
|
||||
system_prompt: |
|
||||
@@ -167,6 +169,7 @@ jobs:
|
||||
prompt_file: chack_prompt.txt
|
||||
tools_config_json: "{\"exec_enabled\": true}"
|
||||
session_config_json: "{\"long_term_memory_enabled\": false}"
|
||||
agent_config_json: "{\"self_critique_enabled\": false, \"require_task_list_init_first\": true}"
|
||||
openrouter_api_key: ${{ secrets.OPENROUTER_API_KEY }}
|
||||
|
||||
- name: Commit and push if changed
|
||||
@@ -180,9 +183,24 @@ jobs:
|
||||
fi
|
||||
rm -f chack_failure_summary.txt chack_prompt.txt
|
||||
git add -A
|
||||
# Avoid workflow-file pushes with token scopes that cannot write workflows.
|
||||
git reset -- .github/workflows || true
|
||||
git checkout -- .github/workflows || true
|
||||
git clean -fdx -- .github/workflows || true
|
||||
git reset -- chack_failure_summary.txt chack_prompt.txt
|
||||
if git diff --cached --name-only | grep -q '^.github/workflows/'; then
|
||||
echo "Workflow-file changes are still staged; skipping push without workflows permission."
|
||||
exit 0
|
||||
fi
|
||||
if git diff --cached --quiet; then
|
||||
echo "No committable changes left after filtering."
|
||||
exit 0
|
||||
fi
|
||||
git commit -m "Fix CI failures for PR #${PR_NUMBER}"
|
||||
git push origin HEAD:${TARGET_BRANCH}
|
||||
if ! git push origin HEAD:${TARGET_BRANCH}; then
|
||||
echo "Push failed (likely token workflow permission limits); leaving run successful without push."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
- name: Comment with Chack Agent result
|
||||
if: ${{ steps.run_chack.outputs.final-message != '' }}
|
||||
|
||||
@@ -53,4 +53,3 @@ if __name__ == "__main__":
|
||||
exit(1)
|
||||
|
||||
main(all_modules, all_no_fat_modules, no_network_scanning, small, include_modules, exclude_modules, output)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user