Skip to content

Commit 7b29497

Browse files
authored
Merge branch 'master' into renovate/gitleaks-gitleaks-8.x
2 parents abf74f6 + d2a8e5c commit 7b29497

File tree

8 files changed

+35
-15
lines changed

8 files changed

+35
-15
lines changed

.github/workflows/ci-cd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
steps:
111111
- name: Switch to using Python 3.13 by default
112112
# yamllint disable-line rule:line-length
113-
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
113+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
114114
with:
115115
python-version: 3.13
116116
- name: Check out src from Git
@@ -275,7 +275,7 @@ jobs:
275275
steps:
276276
- name: Switch to using Python 3.13
277277
# yamllint disable-line rule:line-length
278-
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
278+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
279279
with:
280280
python-version: 3.13
281281

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
# Initializes the CodeQL tools for scanning.
4949
- name: Initialize CodeQL
5050
# yamllint disable-line rule:line-length
51-
uses: github/codeql-action/init@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
51+
uses: github/codeql-action/init@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
5252
with:
5353
languages: ${{ matrix.language }}
5454
# If you wish to specify custom queries, you can do so here or in
@@ -61,7 +61,7 @@ jobs:
6161
# manually (see below)
6262
- name: Autobuild
6363
# yamllint disable-line rule:line-length
64-
uses: github/codeql-action/autobuild@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
64+
uses: github/codeql-action/autobuild@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
6565

6666
# ℹ️ Command-line programs to run using the OS shell.
6767
# yamllint disable-line rule:line-length
@@ -77,6 +77,6 @@ jobs:
7777

7878
- name: Perform CodeQL Analysis
7979
# yamllint disable-line rule:line-length
80-
uses: github/codeql-action/analyze@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
80+
uses: github/codeql-action/analyze@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
8181
with:
8282
category: /language:${{matrix.language}}

.github/workflows/pre-commit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
ref: ${{ github.event.pull_request.head.sha }}
5757
# Skip terraform_tflint which interferes to commit pre-commit auto-fixes
5858
# yamllint disable-line rule:line-length
59-
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
59+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
6060
with:
6161
python-version: '3.9'
6262
- name: Execute pre-commit

.github/workflows/reusable-tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ jobs:
159159
by default
160160
id: python-install
161161
# yamllint disable-line rule:line-length
162-
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
162+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
163163
with:
164164
python-version: ${{ inputs.python-version }}
165165

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ jobs:
7979
# Upload the results to GitHub's code scanning dashboard.
8080
- name: Upload to code-scanning
8181
# yamllint disable-line rule:line-length
82-
uses: github/codeql-action/upload-sarif@f6091c0113d1dcf9b98e269ee48e8a7e51b7bdd4 # v3.28.5
82+
uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
8383
with:
8484
sarif_file: results.sarif

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.97.3](https://github.com/antonbabenko/pre-commit-terraform/compare/v1.97.2...v1.97.3) (2025-02-04)
6+
7+
8+
### Bug Fixes
9+
10+
* **`terraform_docs`:** Fix bug introduced in `v1.97.2` ([#801](https://github.com/antonbabenko/pre-commit-terraform/issues/801)) ([64b81f4](https://github.com/antonbabenko/pre-commit-terraform/commit/64b81f449344ed72d180d57ce0a801389c018584)), closes [#796](https://github.com/antonbabenko/pre-commit-terraform/issues/796)
11+
512
## [1.97.2](https://github.com/antonbabenko/pre-commit-terraform/compare/v1.97.1...v1.97.2) (2025-02-03)
613

714

hooks/_common.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ function common::initialize {
5252
function common::parse_cmdline {
5353
# common global arrays.
5454
# Populated via `common::parse_cmdline` and can be used inside hooks' functions
55-
ARGS=() HOOK_CONFIG=() FILES=()
55+
ARGS=()
56+
HOOK_CONFIG=()
57+
FILES=()
5658
# Used inside `common::terraform_init` function
5759
TF_INIT_ARGS=()
5860
# Used inside `common::export_provided_env_vars` function

hooks/terraform_docs.sh

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function terraform_docs {
160160
# `--hook-config=--path-to-file=` if it set
161161
local config_output_file
162162
# Get latest non-commented `output.file` from `.terraform-docs.yml`
163-
config_output_file=$(grep -A1000 -e '^output:$' "$config_file" | grep -E '^[[:space:]]+file:' | tail -n 1) || true
163+
config_output_file=$(grep -A1000 -e '^output:$' "$config_file" 2> /dev/null | grep -E '^[[:space:]]+file:' | tail -n 1) || true
164164

165165
if [[ $config_output_file ]]; then
166166
# Extract filename from `output.file` line
@@ -176,7 +176,7 @@ function terraform_docs {
176176

177177
# Use `.terraform-docs.yml` `output.mode` if it set
178178
local config_output_mode
179-
config_output_mode=$(grep -A1000 -e '^output:$' "$config_file" | grep -E '^[[:space:]]+mode:' | tail -n 1) || true
179+
config_output_mode=$(grep -A1000 -e '^output:$' "$config_file" 2> /dev/null | grep -E '^[[:space:]]+mode:' | tail -n 1) || true
180180
if [[ $config_output_mode ]]; then
181181
# Extract mode from `output.mode` line
182182
output_mode=$(echo "$config_output_mode" | awk -F':' '{print $2}' | tr -d '[:space:]"' | tr -d "'")
@@ -240,10 +240,21 @@ function terraform_docs {
240240
have_marker=$(grep -o "$insertion_marker_begin" "$output_file") || unset have_marker
241241
[[ ! $have_marker ]] && popd > /dev/null && continue
242242
fi
243-
local config_options
244-
[[ $have_config_flag == true ]] && config_options="--config=$config_file"
245-
# shellcheck disable=SC2086
246-
terraform-docs --output-mode="$output_mode" --output-file="$output_file" $tf_docs_formatter "$config_options" $args ./ > /dev/null
243+
244+
# shellcheck disable=SC2206
245+
# Need to pass $tf_docs_formatter and $args as separate arguments, not as single string
246+
local tfdocs_cmd=(
247+
terraform-docs
248+
--output-mode="$output_mode"
249+
--output-file="$output_file"
250+
$tf_docs_formatter
251+
$args
252+
)
253+
if [[ $have_config_flag == true ]]; then
254+
"${tfdocs_cmd[@]}" "--config=$config_file" ./ > /dev/null
255+
else
256+
"${tfdocs_cmd[@]}" ./ > /dev/null
257+
fi
247258

248259
popd > /dev/null
249260
done

0 commit comments

Comments
 (0)