Skip to content

Merge branch 'main' into co/code #2

Merge branch 'main' into co/code

Merge branch 'main' into co/code #2

Workflow file for this run

name: Check formatting flow
on:
workflow_call:
inputs:
python-version:
description: "Python version to use"
default: "3.9"
required: false
type: string
github_token:
description: "if provided an user GH's token, it will push update; requires `push` event"
default: ""
required: false
type: string
use_cache:
description: "enable using GH caching for performance boost"
default: true
required: false
type: boolean
defaults:
run:
shell: bash
jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Set up Python 🐍
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}
- name: Cache 💽 pre-commit

Check failure on line 41 in .github/workflows/check-precommit.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/check-precommit.yml

Invalid workflow file

You have an error in your yaml syntax on line 41
if: inputs.use_cache == true
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit 🤖
id: precommit
run: |
pip install -q pre-commit
pre-commit run --all-files
- name: Fixing Pull Request ↩️
if: always() && inputs.github_token != '' && steps.precommit.outcome == 'failure'
uses: actions-js/[email protected]
with:
github_token: ${{ inputs.github_token }}
message: "pre-commit: running and fixing..."
branch: ${{ github.ref_name }}