Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/agents/ci-cleaner.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,23 @@ You are a specialized AI agent that **tidies up the repository CI state** in the

Read the ENTIRE content of this file carefully before proceeding. Follow the instructions precisely.

## First Step: Check CI Status

**IMPORTANT**: Before doing any work, check if the CI is currently failing or passing by examining the workflow context provided to you.

If the workflow context indicates that **CI is passing** (e.g., `ci_status: success`):
1. **STOP immediately** - Do not run any commands
2. **Call the `noop` tool** (from the safe-outputs MCP server) with a message like:
```
CI is passing on main branch - no cleanup needed
```
3. **Exit** - Your work is done

If the workflow context indicates that **CI is failing** (e.g., `ci_status: failure`), proceed with the cleanup tasks below.

## Your Responsibilities

You perform the following tasks in sequence to clean up the CI state:
When CI is failing, you perform the following tasks in sequence to clean up the CI state:

1. **Format sources** (Go, JavaScript, JSON)
2. **Run linters** and fix any linting issues
Expand Down
33 changes: 29 additions & 4 deletions .github/workflows/hourly-ci-cleaner.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions .github/workflows/hourly-ci-cleaner.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ jobs:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
outputs:
ci_needs_fix: ${{ steps.ci_check.outputs.ci_needs_fix }}
ci_status: ${{ steps.ci_check.outputs.ci_status }}
ci_run_id: ${{ steps.ci_check.outputs.ci_run_id }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Check last CI workflow run status on main branch
id: ci_check
env:
Expand Down Expand Up @@ -122,9 +125,17 @@ When CI fails on the main branch, automatically diagnose and fix the issues by:
- **CI Status**: ${{ needs.check_ci_status.outputs.ci_status }}
- **CI Run ID**: ${{ needs.check_ci_status.outputs.ci_run_id }}

## Your Task
## First: Check CI Status

The CI workflow has failed on the main branch. Follow the instructions from the ci-cleaner agent to:
**CRITICAL**: Before starting any work, check the CI Status value above:

- **If CI Status is "success"**: The CI is passing. **Call the `noop` tool** immediately with message "CI is passing on main branch - no cleanup needed" and **stop**. Do not run any commands or make any changes.

- **If CI Status is "failure"** or anything else: The CI workflow has failed. Proceed with the cleanup tasks below.

## Your Task (Only if CI Status is "failure")

Follow the instructions from the ci-cleaner agent to:

1. **Format sources** - Run `make fmt` to format all code
2. **Run linters** - Run `make lint` and fix any issues
Expand Down
137 changes: 100 additions & 37 deletions pkg/cli/templates/create-agentic-workflow.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading