Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Linuxfabrik: Dependabot auto-merge'
name: 'Linuxfabrik: Auto-merge'

on:
pull_request: {}
Expand All @@ -17,7 +17,7 @@ env:
FROZEN_LOCKFILES: '[]'

jobs:
auto-merge:
dependabot:
runs-on: 'ubuntu-latest'
if: 'github.actor == ''dependabot[bot]'''
permissions:
Expand Down Expand Up @@ -63,3 +63,24 @@ jobs:
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
PR_URL: '${{ github.event.pull_request.html_url }}'

# The weekly hook bump carries nothing but `rev:` changes in
# .pre-commit-config.yaml, and it arrives in every repository at once.
# Merging that by hand is pure overhead, so it goes in as soon as the
# required checks pass. The same fallback as above applies, and it is only
# safe because the ruleset keeps enforcing those checks server-side.
pre-commit-autoupdate:
runs-on: 'ubuntu-latest'
if: >-
github.actor == 'linuxfabrik-automation[bot]'
&& github.head_ref == 'chore/pre-commit-autoupdate'
permissions:
contents: 'write'
pull-requests: 'write'
steps:

- run: |
gh pr merge --auto --squash "$PR_URL" || gh pr merge --squash "$PR_URL"
env:
GH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
PR_URL: '${{ github.event.pull_request.html_url }}'
40 changes: 40 additions & 0 deletions .github/workflows/lf-pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Linuxfabrik: Pre-commit'

on:
push:
branches:
- 'main'
pull_request: {}

permissions:
contents: 'read'

jobs:
pre-commit:
name: 'Pre-commit'
runs-on: 'ubuntu-latest'
steps:
- name: 'Harden the runner (Audit all outbound calls)'
uses: 'step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c' # v2.21.0
with:
egress-policy: 'audit'

- name: 'Checkout repository'
uses: 'actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1' # v7.0.1

# The repository carries no Python sources, so this interpreter only
# runs the hook framework itself. Pinned explicitly so a runner image
# change cannot move it silently.
- name: 'Set up Python'
uses: 'actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97' # v7.0.0
with:
python-version: '3.13'

- name: 'Install pre-commit'
run: 'pip install --require-hashes --requirement .github/pre-commit/requirements.txt'

# --all-files, because the hooks otherwise only see what a commit
# happens to touch, and nothing guarantees a contributor ran
# `pre-commit install` at all.
- name: 'Run the hooks over the whole tree'
run: 'pre-commit run --all-files --show-diff-on-failure'