Skip to content

Update github/codeql-action action to v4.37.9 #38

Update github/codeql-action action to v4.37.9

Update github/codeql-action action to v4.37.9 #38

name: Run pre-commit
on: [ push, pull_request ]
# Declare default permissions as read only.
permissions: read-all
jobs:
pre-commit:
runs-on: ubuntu-latest
name: pre-commit
steps:
- name: Harden Runner
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.x
- name: Remove rh-pre-commit hook (requires VPN)
uses: mikefarah/yq@c14f446382944492701b16c1ddb48bb9dbe683e3 # v4.53.6
with:
cmd: yq -i 'del( .repos[] | select(.rev == "rh-pre-commit-*"))' .pre-commit-config.yaml
- uses: garethahealy/pre-commit-action@b9b3eedc18230d01ce1d0d44683dacd87beedfd2 # v4.6.1
- name: Check if there are changes
id: changes
run: |
git checkout HEAD -- .pre-commit-config.yaml
echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Fail if changes found
if: steps.changes.outputs.changed >= 1
run: |
echo "Uncommitted changes exist. Failing."
echo
git status --porcelain
exit 1