Skip to content

Update actions/setup-python action to v5.1.0 (#1047) #68

Update actions/setup-python action to v5.1.0 (#1047)

Update actions/setup-python action to v5.1.0 (#1047) #68

Workflow file for this run

---
name: Python Black Formatting
on:
push:
branches:
- grass[0-9]+
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress:
# Do not cancel on protected branches, like grass8
${{ github.ref_protected != true }}
permissions: {}
jobs:
run-black:
name: Black ${{ matrix.black-version }}
# Using matrix just to get variables which are not environmental variables
# and also to sync with other workflows which use matrix.
strategy:
matrix:
include:
- os: ubuntu-22.04
python-version: "3.10"
black-version: 24.3.0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: Install
run: |
python -m pip install --upgrade pip
pip install black[jupyter]==${{ matrix.black-version }}
- name: Run Black
run: |
black .
- name: Create and uploads code suggestions to apply
id: diff
uses: ./.github/actions/create-upload-suggestions
with:
tool-name: black
# To keep repo's file structure in formatted changes artifact
extra-upload-changes: .clang-format