Skip to content

Update softprops/action-gh-release action to v3 #898

Update softprops/action-gh-release action to v3

Update softprops/action-gh-release action to v3 #898

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@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.x
- name: Remove rh-pre-commit hook (requires VPN)
uses: mikefarah/yq@5a7e72a743649b1b3a47d1a1d8214f3453173c51 # v4.52.4
with:
cmd: yq -i 'del( .repos[] | select(.rev == "rh-pre-commit-*"))' .pre-commit-config.yaml
- uses: garethahealy/pre-commit-action@9638b5f3212a29c34d088fd7d239a62061ea621c # v4.5.1-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