Skip to content

Commit 376d722

Browse files
authored
ci: Use stackabletech/actions repo (#442)
* ci: Use stackabletech/actions repo * chore: Bump run-pre-commit action to 0.0.2
1 parent 60551e9 commit 376d722

File tree

3 files changed

+15
-49
lines changed

3 files changed

+15
-49
lines changed

.github/workflows/pr_pre-commit.yml

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
env:
88
HADOLINT_VERSION: "v2.12.0"
9+
PYTHON_VERSION: "3.12"
910

1011
jobs:
1112
pre-commit:
@@ -14,27 +15,7 @@ jobs:
1415
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
1516
with:
1617
fetch-depth: 0
17-
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
18+
- uses: stackabletech/actions/run-pre-commit@e8781161bc1eb037198098334cec6061fe24b6c3 # v0.0.2
1819
with:
19-
python-version: '3.12'
20-
- name: Setup Hadolint
21-
# We need to download this here due to a bug in the pre-commit/hadolint setup
22-
# https://github.com/hadolint/hadolint/issues/886
23-
shell: bash
24-
run: |
25-
set -euo pipefail
26-
27-
LOCATION_DIR="$HOME/.local/bin"
28-
LOCATION_BIN="$LOCATION_DIR/hadolint"
29-
30-
SYSTEM=$(uname -s)
31-
ARCH=$(uname -m)
32-
33-
mkdir -p "$LOCATION_DIR"
34-
curl -sL -o "${LOCATION_BIN}" "https://github.com/hadolint/hadolint/releases/download/${{ env.HADOLINT_VERSION }}/hadolint-$SYSTEM-$ARCH"
35-
chmod 700 "${LOCATION_BIN}"
36-
37-
echo "$LOCATION_DIR" >> "$GITHUB_PATH"
38-
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
39-
with:
40-
extra_args: "--from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}"
20+
python-version: ${{ env.PYTHON_VERSION }}
21+
hadolint: ${{ env.HADOLINT_VERSION }}

config/versions.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ rust_version: 1.80.1
66

77
# IMPORTANT
88
# If you change the Hadolint version here, make sure to also change the hook
9-
# refs in the local and template .pre-commit-config.yaml files.
9+
# refs in the local and templated .pre-commit-config.yaml files.
1010
# And due to a bug you also need to update the version in .github/workflows/pr_pre_commit.yml
1111
hadolint_version: v2.12.0
12+
13+
# IMPORTANT
14+
# If you change the Python version here, make sure to also change it in
15+
# .github/workflows/pr_pre-commit.yml
16+
python_version: 3.12

template/.github/workflows/pr_pre-commit.yaml.j2

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ env:
88
CARGO_TERM_COLOR: always
99
RUST_TOOLCHAIN_VERSION: "{[ rust_version }]"
1010
HADOLINT_VERSION: "{[ hadolint_version }]"
11+
PYTHON_VERSION: "{[ python_version }]"
1112

1213
jobs:
1314
pre-commit:
@@ -22,29 +23,8 @@ jobs:
2223
with:
2324
fetch-depth: 0
2425
submodules: recursive
25-
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
26+
- uses: stackabletech/actions/run-pre-commit@e8781161bc1eb037198098334cec6061fe24b6c3 # v0.0.2
2627
with:
27-
python-version: '3.12'
28-
- uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
29-
with:
30-
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
31-
components: rustfmt,clippy
32-
- name: Setup Hadolint
33-
shell: bash
34-
run: |
35-
set -euo pipefail
36-
37-
LOCATION_DIR="$HOME/.local/bin"
38-
LOCATION_BIN="$LOCATION_DIR/hadolint"
39-
40-
SYSTEM=$(uname -s)
41-
ARCH=$(uname -m)
42-
43-
mkdir -p "$LOCATION_DIR"
44-
curl -sL -o "${LOCATION_BIN}" "https://github.com/hadolint/hadolint/releases/download/${{ env.HADOLINT_VERSION }}/hadolint-$SYSTEM-$ARCH"
45-
chmod 700 "${LOCATION_BIN}"
46-
47-
echo "$LOCATION_DIR" >> "$GITHUB_PATH"
48-
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
49-
with:
50-
extra_args: "--from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}"
28+
python-version: ${{ env.PYTHON_VERSION }}
29+
rust: ${{ env.RUST_TOOLCHAIN_VERSION }}
30+
hadolint: ${{ env.HADOLINT_VERSION }}

0 commit comments

Comments
 (0)