Add third python version #596
Workflow file for this run
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
# Uses Black to reformat the Python code on the all but the main branch. | |
name: Format | |
on: | |
push: | |
branches: | |
- '**' # matches every branch | |
- '!main' # excludes master | |
permissions: | |
contents: write | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the main branch | |
- uses: actions/checkout@v3 | |
# Setup Python environment | |
- uses: actions/setup-python@v3 | |
# Install black | |
- name: Install black | |
run: pip install black | |
# Execute black in check mode | |
- name: Black | |
id: black | |
run: echo ::set-output name=format::$(black --check --quiet . || echo "true") | |
# Execute black and commit the change to the main branch | |
- name: Commit to the main branch | |
if: steps.black.outputs.format == 'true' | |
run: | | |
black . | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git commit -am "[github-action] formatting fixes" | |
git push |