Skip to content

testing automatic reformatter with test file #7

testing automatic reformatter with test file

testing automatic reformatter with test file #7

Workflow file for this run

name: X17-Surface Linter
# Controls when the action will run.
# Workflow runs when manually triggered using the UI, or when a push or pull request is made to the main branch
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
# Check out the repository
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
# Install black
- name: Install black
run: pip install black
# Run black
- name: Run black
run: black --check .
# Check for code changes
- name: Check for code changes
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if [[ 'git status --porcelain' ]]; then
git add .
git commit -m "Auto-format code with black"
git push
fi
# Success message
- name: Success
run: echo "Success!"