Skip to content

Commit

Permalink
restoring files
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanburmane committed Oct 17, 2024
1 parent 2f0f55c commit 526932f
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ name: X17-Surface Build Test
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
workflow_dispatch:

jobs:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/python_linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: X17-Surface Python 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
workflow_dispatch:

permissions:
contents: write # Grant write access to repository contents

jobs:
format:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install Black
run: |
python -m pip install --upgrade pip
pip install black
- name: Run Black to format code
run: black .

- name: Commit changes if there are any
run: |
git config --local user.name "GitHub Action"
git config --local user.email "[email protected]"
git diff --exit-code || (git add . && git commit -m "Auto-format code using Black" && git push)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Use GitHub token for authentication

0 comments on commit 526932f

Please sign in to comment.