File tree Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 32
32
- lint-examples-tf
33
33
- lint-examples-sh
34
34
- lint-generated
35
+ - lint-custom
35
36
steps :
36
37
- uses : actions/setup-go@v2
37
38
with :
Original file line number Diff line number Diff line change 44
44
- lint-examples-tf
45
45
- lint-examples-sh
46
46
- lint-generated
47
+ - lint-custom
47
48
steps :
48
49
- uses : actions/setup-go@v2
49
50
with :
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ lint-generated: generate ## Check that "make generate" was called. Note this onl
51
51
exit 1; \
52
52
}
53
53
54
+ lint-custom : # # Run custom checks and validations that do not fit into an existing lint framework.
55
+ @./scripts/lint-custom.sh
56
+
54
57
apicovered : tool-apicovered # # Run an analysis tool to estimate the GitLab API coverage.
55
58
@$(GOBIN ) /apicovered ./gitlab
56
59
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env sh
2
+
3
+ # This script is run during the CI workflow in order to run additional custom checks and validations
4
+ # that do not fit into an existing lint framework.
5
+ #
6
+ # This script uses GitHub workflow commands in order to add contextual error messages:
7
+ # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message
8
+ #
9
+ # Usage:
10
+ # ./scripts/lint-custom.sh
11
+
12
+ has_failure=' '
13
+
14
+ pattern=" ^\*\*Upstream API\*\*: \[.*\](.*)$"
15
+ files_without_match=" $( grep --recursive --files-without-match " $pattern " ./docs/resources ./docs/data-sources) "
16
+ test -z " $files_without_match " || {
17
+ has_failure=' true'
18
+ echo " $files_without_match " | xargs -I{} echo " ::error file={}::Generated documentation file {} should reference an upstream GitLab API. Expected file to match regex \" $pattern \" ."
19
+ }
20
+
21
+ # ^^^ Add new checks above this line ^^^
22
+
23
+ test -z " $has_failure "
You can’t perform that action at this time.
0 commit comments