Skip to content

Commit 2fcd238

Browse files
committed
test: add validation for action outputs in CI workflow
1 parent a39f1f1 commit 2fcd238

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,34 @@ jobs:
5252
module-change-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/**
5353
module-asset-exclude-patterns: .gitignore,*.md,*.tftest.hcl,tests/**
5454
use-ssh-source-format: true
55+
56+
- name: Test Action Outputs
57+
id: test-outputs
58+
run: |
59+
echo "Testing action outputs..."
60+
61+
# Test if outputs are set
62+
if [[ -n "${{ steps.test-action.outputs.changed_module_names }}" ]]; then
63+
echo "✅ Changed module names: ${{ steps.test-action.outputs.changed_module_names }}"
64+
else
65+
echo "❌ No changed module names found"
66+
fi
67+
68+
if [[ -n "${{ steps.test-action.outputs.changed_module_paths }}" ]]; then
69+
echo "✅ Changed module paths: ${{ steps.test-action.outputs.changed_module_paths }}"
70+
else
71+
echo "❌ No changed module paths found"
72+
fi
73+
74+
if [[ -n "${{ steps.test-action.outputs.changed_modules_map }}" ]]; then
75+
echo "✅ Changed modules map:"
76+
echo "${{ steps.test-action.outputs.changed_modules_map }}"
77+
else
78+
echo "❌ No changed modules map found"
79+
fi
80+
81+
# Validate JSON format of changed_modules_map
82+
if ! echo "${{ steps.test-action.outputs.changed_modules_map }}" | jq '.' >/dev/null 2>&1; then
83+
echo "❌ Changed modules map is not valid JSON"
84+
exit 1
85+
fi

0 commit comments

Comments
 (0)