Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tflint 0.62.1
terraform-docs 0.24.0
go 1.26.5
go:github.com/hashicorp/terraform-config-inspect latest
pre-commit 4.6.0
pre-commit 4.6.2
python 3.12
vale 3.6.0
gitleaks 8.30.1
Expand Down
176 changes: 104 additions & 72 deletions mise.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ idiomatic_version_file_enable_tools = ["node", "python", "terraform"]
terraform = "1.13.5"
tflint = "0.62.1"
terraform-docs = "0.24.0"
pre-commit = "4.6.0"
pre-commit = "4.6.2"
python = "3.12"
vale = "3.6.0"
gitleaks = "8.30.1"
Expand Down
28 changes: 16 additions & 12 deletions tests/test-workflow-security.sh
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,30 @@ check_file_exists ".tool-versions"
check_file_exists "mise.toml"
check_file_exists "mise.lock"

# Count matching tool lines
if [ -f ".tool-versions" ] && [ -f "mise.toml" ]; then
# Get terraform version from both
TV_VERSION=$(grep "^terraform " ".tool-versions" | awk '{print $2}')
MT_VERSION=$(grep 'terraform.*=' "mise.toml" | grep -v '#' | head -1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
test_tool_version_sync() {
local tool="$1"
local tool_version
local mise_version

tool_version=$(awk -v tool="$tool" '$1 == tool { print $2; exit }' ".tool-versions")
mise_version=$(awk -F '"' -v tool="$tool" '$1 ~ "^[[:space:]]*" tool "[[:space:]]*=[[:space:]]*$" { print $2; exit }' "mise.toml")

if [ "$TV_VERSION" = "$MT_VERSION" ]; then
printf "%-60s ... " "$tool versions in sync"
if [ -n "$tool_version" ] && [ "$tool_version" = "$mise_version" ]; then
PASSED=$((PASSED + 1))
printf "%-60s ... " "Terraform versions in sync"
printf "%b\n" "${GREEN}✓${NC}"
else
FAILED=$((FAILED + 1))
printf "%-60s ... " "Terraform versions in sync"
printf "%b\n" "${RED}✗${NC}"
printf " .tool-versions: %s, mise.toml: %s\n" "$TV_VERSION" "$MT_VERSION"
printf " .tool-versions: %s, mise.toml: %s\n" "$tool_version" "$mise_version"
fi
fi
}

test_pattern_exists ".tool-versions" "pre-commit 4\\.6\\.0" "pre-commit version in .tool-versions"
test_pattern_exists "mise.toml" "pre-commit.*4\\.6\\.0" "pre-commit version in mise.toml"
if [ -f ".tool-versions" ] && [ -f "mise.toml" ]; then
for tool in terraform pre-commit; do
test_tool_version_sync "$tool"
done
fi
echo ""

# Summary
Expand Down
Loading