Skip to content

Commit b850bc6

Browse files
committed
Revert "chore: Remove unused pre-commit hooks"
This reverts commit 8b3033d.
1 parent 0158cbf commit b850bc6

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.github/workflows/pr_pre-commit.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ name: pre-commit
44
on:
55
pull_request:
66

7+
env:
8+
HADOLINT_VERSION: "v1.17.6"
9+
710
jobs:
811
pre-commit:
912
runs-on: ubuntu-latest
@@ -14,6 +17,22 @@ jobs:
1417
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
1518
with:
1619
python-version: '3.12'
20+
- name: Setup Hadolint
21+
shell: bash
22+
run: |
23+
set -euo pipefail
24+
25+
LOCATION_DIR="$HOME/.local/bin"
26+
LOCATION_BIN="$LOCATION_DIR/hadolint"
27+
28+
SYSTEM=$(uname -s)
29+
ARCH=$(uname -m)
30+
31+
mkdir -p "$LOCATION_DIR"
32+
curl -sL -o "${LOCATION_BIN}" "https://github.com/hadolint/hadolint/releases/download/${{ env.HADOLINT_VERSION }}/hadolint-$SYSTEM-$ARCH"
33+
chmod 700 "${LOCATION_BIN}"
34+
35+
echo "$LOCATION_DIR" >> "$GITHUB_PATH"
1736
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
1837
with:
1938
extra_args: "--from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}"

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,8 @@ repos:
4949
rev: 62dc61a45fc95efe8c800af7a557ab0b9165d63b # 1.7.1
5050
hooks:
5151
- id: actionlint
52+
53+
- repo: https://github.com/hadolint/hadolint
54+
rev: b3555ba9c2bfd9401e79f2f0da68dd1ae38e10c7 # 2.12.0
55+
hooks:
56+
- id: hadolint

0 commit comments

Comments
 (0)