Skip to content

Тихая установка моделей + сообщение о запуске интерфейса #445

Тихая установка моделей + сообщение о запуске интерфейса

Тихая установка моделей + сообщение о запуске интерфейса #445

name: Code Formatter
on:
push:
branches:
- PolGen
jobs:
push_format:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade black isort autoflake
- name: Run autoflake
run: autoflake --in-place --recursive .
- name: Run isort
run: isort .
- name: Run Black
run: black . --line-length 140
- name: Check for changes
id: changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::set-output name=has_changes::true"
else
echo "::set-output name=has_changes::false"
fi
- name: Commit changes
if: steps.changes.outputs.has_changes == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add --all
git commit -m "Automatic code formatting with black"
- name: Create Pull Request
if: steps.changes.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v5
with:
delete-branch: true
body: "Automatic code formatting with black"
title: "Automatic code formatting"
commit-message: "Automatic code formatting with black"
branch: formatter/PolGen