Run pre-commit #317
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
# Copyright (c) 2023 Sebastian Pipping <sebastian@pipping.org> | |
# Licensed under the Apache License Version 2.0 | |
name: Run pre-commit | |
# Drop permissions to minimum for security | |
permissions: | |
contents: read | |
on: | |
pull_request: | |
push: | |
schedule: | |
- cron: '0 2 * * 5' # Every Friday at 2am | |
workflow_dispatch: | |
jobs: | |
pre_commit_run: | |
name: Run pre-commit | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 | |
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | |
with: | |
python-version: 3.11 | |
- name: Install yapf (to be available to pre-commit) | |
run: |- | |
pip install \ | |
--disable-pip-version-check \ | |
--no-warn-script-location \ | |
--user \ | |
. | |
echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}" | |
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 |