Skip to content

Commit 3dade45

Browse files
ci: let the pre-commit job fail (#105)
The job installed Terraform, TFLint and terraform-docs, then skipped two of them and appended `|| true`, so it could not fail under any circumstance. Every green "pre-commit checks" tick on this repository meant nothing. That is not theoretical. Three genuine failures sat on master behind it: two whitespace hooks, and a tflint unused-declaration that turned out to be a real bug where spot_schedule_enabled did nothing at all (#104). Drop the `|| true` and re-add the trailing newlines that #83 reintroduced, so the gate passes on the current tree. terraform_tflint stays skipped. It still reports terraform_standard_module_structure against the examples, which use example.tf rather than main.tf by CloudDrove convention across every module. That is a convention decision rather than a defect, and re-enabling the hook belongs in its own change alongside whatever is decided.
1 parent b950f06 commit 3dade45

10 files changed

Lines changed: 21 additions & 12 deletions

.github/workflows/automerge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ jobs:
1818
tfchecks_azure: '["tf-lint / tflint"]'
1919
secrets:
2020
GITHUB: ${{ secrets.GITHUB }}
21-
...
21+
...

.github/workflows/pr-auto-assignee.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
GITHUB: ${{ secrets.GITHUB_TOKEN }}
1414
with:
1515
assignees: 'clouddrove-ci'
16-
...
16+
...

.github/workflows/pr-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ jobs:
88
pr-validation:
99
if: github.actor != 'dependabot[bot]'
1010
uses: clouddrove/github-shared-workflows/.github/workflows/pr-checks.yml@v2
11-
...
11+
...

.github/workflows/pre-commit.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,14 @@ jobs:
3535
run: pip install pre-commit
3636

3737
- name: Run pre-commit
38-
run: SKIP=terraform_validate,terraform_tflint pre-commit run -a --show-diff-on-failure || true
39-
...
38+
# No trailing `|| true`: this job installed Terraform, TFLint and
39+
# terraform-docs and then could not fail, so three real hook failures sat
40+
# on master unnoticed, including a tflint warning that turned out to be a
41+
# genuine bug in spot_schedule_enabled.
42+
#
43+
# terraform_tflint stays skipped for now. It still reports
44+
# terraform_standard_module_structure against the examples, which use
45+
# example.tf rather than main.tf by CloudDrove convention. That is a
46+
# convention decision, not a defect, and belongs in its own change.
47+
run: SKIP=terraform_tflint pre-commit run -a --show-diff-on-failure
48+
...

.github/workflows/readme.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
secrets:
1414
TOKEN : ${{ secrets.GITHUB }}
1515
SLACK_WEBHOOK_TERRAFORM: ${{ secrets.SLACK_WEBHOOK_TERRAFORM }}
16-
...
16+
...

.github/workflows/release-changelog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ jobs:
1212
tag_format: vX.Y.Z
1313
release_tag: ${{ github.ref_name }}
1414
secrets:
15-
GITHUB: ${{ secrets.GITHUB_TOKEN }}
15+
GITHUB: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/security-tfsec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
secrets: inherit
1515
with:
1616
working_directory: '.'
17-
...
17+
...

.github/workflows/tf-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
show_plan: false
3232
secrets:
3333
BUILD_ROLE: ${{ secrets.BUILD_ROLE }}
34-
...
34+
...

.github/workflows/tflint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ jobs:
1111
uses: clouddrove/github-shared-workflows/.github/workflows/tf-lint.yml@v2
1212
secrets:
1313
GITHUB: ${{ secrets.GITHUB_TOKEN }}
14-
...
14+
...

commitlint.config.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module.exports = {
33
rules: {
44
'type-enum': [2, 'always', [
55
'fix', 'feat', 'docs', 'ci', 'chore', 'test', 'refactor', 'style', 'perf', 'build', 'revert',
6-
'Fix', 'Feat', 'Docs', 'Ci', 'Chore', 'Test', 'Refactor', 'Style', 'Perf', 'Build', 'Revert'
6+
'Fix', 'Feat', 'Docs', 'Ci', 'Chore', 'Test', 'Refactor', 'Style', 'Perf', 'Build', 'Revert'
77
]],
88
'header-max-length': [2, 'always', 150],
99
'subject-case': [0],
1010
'type-case': [0],
1111
}
12-
};
12+
};

0 commit comments

Comments
 (0)