Skip to content

Formatting more.

Formatting more. #183

Workflow file for this run

---
#################################
#################################
## Super Linter GitHub Actions ##
#################################
#################################
name: Lint Code Base
#
# Documentation:
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#
#############################
# Start the job on all push #
#############################
on:
[push, pull_request]
###############
# Set the Job #
###############
jobs:
lint:
name: Black auto formatting
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
statuses: write
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
options:
- name: Set up git
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
- name: Checkout to the branch
if: github.head_ref != ''
env:
HEAD_REF: ${{ github.head_ref }}
run: |
git fetch origin
git checkout $HEAD_REF
- name: Commit files if pull request
if: github.event_name == 'pull_request'
run: |
git add -u
git diff --cached --quiet || git commit -m "Apply Black formatting"
git push --set-upstream origin $(git symbolic-ref --short HEAD)
- name: Commit files
run: |
git add -u
git diff --cached --quiet || git commit -m "Apply Black formatting"
git push