refactor: make Agent.step()
multi-step
#3229
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Formatter (Black) | |
on: | |
pull_request: | |
paths: | |
- '**.py' | |
workflow_dispatch: | |
jobs: | |
black-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} # Checkout the PR branch | |
fetch-depth: 0 # Fetch all history for all branches and tags | |
- name: "Setup Python, Poetry and Dependencies" | |
uses: packetcoders/action-setup-cache-python-poetry@main | |
with: | |
python-version: "3.12" | |
poetry-version: "1.8.2" | |
install-args: "-E dev" # TODO: change this to --group dev when PR #842 lands | |
- name: Run Black | |
id: black | |
run: poetry run black --check . | |
continue-on-error: true | |
- name: Auto-fix with Black and commit | |
if: steps.black.outcome == 'failure' && !contains(github.event.pull_request.labels.*.name, 'check-only') | |
run: | | |
poetry run black . | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git diff --quiet && git diff --staged --quiet || (git add -A && git commit -m "Apply Black formatting") | |
git push | |
- name: Error if 'check-only' label is present | |
if: steps.black.outcome == 'failure' && contains(github.event.pull_request.labels.*.name, 'check-only') | |
run: echo "Black formatting check failed. Please run 'black .' locally to fix formatting issues." && exit 1 |