Fix GitHub Action 🤐 #4
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
name: Lint codebase | |
# For more details, see original the original version in this repo: | |
# <https://github.com/thijsputman/home-assistant-config/> | |
"on": | |
push: | |
branches: ["**"] | |
tags-ignore: ["**"] | |
pull_request: | |
branches: [main] | |
jobs: | |
lint: | |
name: Run pre-commit | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
with: | |
persist-credentials: false | |
uses: actions/checkout@v3 | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pre-commit | |
~/.cache/pip | |
~/.npm | |
~/.local/bin | |
# yamllint disable rule:line-length | |
# yamllint disable-line rule:quoted-strings | |
key: "pre-commit-cache-\ | |
${{ hashFiles('.pre-commit-config.yaml', '.github/scripts/setup-pre-commit.sh') }}" | |
# yamllint enable rule:line-length | |
- name: Install dependencies | |
env: | |
USE_PIPX: "false" | |
run: .github/scripts/setup-pre-commit.sh | |
shell: bash | |
- name: Run pre-commit | |
run: pre-commit run --color=always --all-files | |
shell: bash |