Update Readme.md & manifest #78
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 | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Format code with Black | |
uses: psf/black@stable | |
with: | |
black_args: . | |
- name: Check for changes | |
id: check_changes | |
run: | | |
# Check if there are code changes | |
git diff --exit-code || echo "Code changes detected" | |
continue-on-error: true | |
- name: Commit formatted code | |
if: steps.check_changes.outputs.exit_code == '0' | |
run: | | |
# Configure Git user | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Actions" | |
# Add and commit changes if any | |
git add . | |
git diff --quiet && git diff --staged --quiet || git commit -m "Format code with Black" | |
- name: Push changes | |
if: steps.check_changes.outputs.exit_code == '0' | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |