Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
"replacements:all",
"workarounds:all"
],
"gitIgnoredAuthors": [
"autofix-ci@users.noreply.github.com",
"autofix-ci[bot]@users.noreply.github.com",
"114827586+autofix-ci[bot]@users.noreply.github.com"
],
"labels": [
"dependencies"
],
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/autofix-pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: autofix.ci

"on":
pull_request:
branches: [main]
workflow_call:
inputs:
skip-autofix:
default: false
required: false
type: boolean

permissions:
contents: read

jobs:
autofix-pre-commit:
env:
UV_FROZEN: true
UV_NO_SYNC: true
UV_PYTHON_DOWNLOADS: never
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Add GB Locale
run: |
sudo apt-get update
sudo apt-get install -y locales
sudo locale-gen en_GB.UTF-8
shell: bash

- name: Set Up Python
uses: actions/setup-python@v6
with:
python-version-file: .python-version

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install prek From Locked Dependencies
run: uv sync --only-group pre-commit

- id: store-hashed-python-version
name: Store Hashed Python Version
run: echo "hashed_python_version=$(uv run -- python -VV | sha256sum | cut -d' ' -f1)"
>> "$GITHUB_OUTPUT"

- uses: actions/cache@v5
with:
key: prek|${{steps.store-hashed-python-version.outputs.hashed_python_version}}|${{hashFiles('.pre-commit-config.yaml')}}
path: ~/.cache/prek

- name: Setup pre-commit Environments
run: uv run -- prek install-hooks

- name: Run prek
run: |
set -o pipefail
if [[ "${{github.event_name}}" == "push" && "${{github.ref_name}}" == "${{github.event.repository.default_branch}}" ]]; then
uv run -- prek run --all-files --hook-stage manual --color never --skip ruff-check --skip uv-lock --skip gitlint-ci | tee /tmp/prek.log
else
uv run -- prek run --all-files --hook-stage manual --color never --skip ruff-check --skip uv-lock | tee /tmp/prek.log
fi

- name: Ensure No Warnings
run: "if grep -q '^warning: ' /tmp/prek.log; then exit 1; fi"

- if: "!cancelled() && inputs.skip-autofix != true"
uses: autofix-ci/action@v1.3.3
63 changes: 6 additions & 57 deletions .github/workflows/check-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ name: Check, Build and Deploy
branches: [main]
tags: [v*]

permissions:
contents: read

jobs:
uv-check:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -110,62 +113,9 @@ jobs:
uv run -- mypy "${ARGS[@]}"

pre-commit: # yamllint disable-line rule:key-ordering
env:
UV_FROZEN: true
UV_NO_SYNC: true
UV_PYTHON_DOWNLOADS: never
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6

- name: Add GB Locale
run: |
sudo apt-get update
sudo apt-get install -y locales
sudo locale-gen en_GB.UTF-8
shell: bash

- name: Set Up Python
uses: actions/setup-python@v6
with:
python-version-file: .python-version

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install prek From Locked Dependencies
run: uv sync --only-group pre-commit

- id: store-hashed-python-version
name: Store Hashed Python Version
run: echo "hashed_python_version=$(uv run -- python -VV | sha256sum | cut -d' ' -f1)"
>> "$GITHUB_OUTPUT"

- uses: actions/cache@v5
with:
key: prek|${{steps.store-hashed-python-version.outputs.hashed_python_version}}|${{hashFiles('.pre-commit-config.yaml')}}
path: ~/.cache/prek

- name: Setup pre-commit Environments
run: uv run -- prek install-hooks

- name: Run prek
run: |
set -o pipefail
if [[ "${{github.event_name}}" == "push" && "${{github.ref_name}}" == "${{github.event.repository.default_branch}}" ]]; then
uv run -- prek run --all-files --hook-stage manual --color never --skip ruff-check --skip uv-lock --skip gitlint-ci | tee /tmp/prek.log
else
uv run -- prek run --all-files --hook-stage manual --color never --skip ruff-check --skip uv-lock | tee /tmp/prek.log
fi

- name: Ensure No Warnings
run: "if grep -q '^warning: ' /tmp/prek.log; then exit 1; fi"

- if: ${{!cancelled()}}
uses: pre-commit-ci/lite-action@v1.1.0
uses: ./.github/workflows/autofix-pre-commit.yaml
with:
skip-autofix: true

pymarkdown: # yamllint disable-line rule:key-ordering
env:
Expand Down Expand Up @@ -290,7 +240,6 @@ jobs:
needs: [mypy, pre-commit, pymarkdown, pytest, ruff-lint, uv-check]
permissions:
attestations: write
contents: read
id-token: write
packages: write
runs-on: ubuntu-latest
Expand Down
Loading