Skip to content

Commit eb39d14

Browse files
chmouelvdemeester
authored andcommitted
chore: Skip revert commits in linter
Added a check to the Tekton linter to skip revert commits. This prevents unnecessary linting of commits that are intended to undo previous changes, streamlining the CI process. Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
1 parent 667fd80 commit eb39d14

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.tekton/linter.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ spec:
119119
continue
120120
fi
121121
122+
# Skip revert commits
123+
if echo "$commit_msg" | grep -E -q '^Revert '; then
124+
echo " Skipping revert commit: $commit_hash"
125+
continue
126+
fi
122127
# Run gitlint check
123128
if ! echo "$commit_body" | gitlint --staged; then
124129
echo " Gitlint failed for commit: $commit_hash"

0 commit comments

Comments
 (0)