testing automatic reformatter with test file #7
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: 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!" |