Skip to content
This repository was archived by the owner on Sep 1, 2025. It is now read-only.

Commit 053ca1d

Browse files
committed
BUILD/MINOR: ci: remove only and use rules for running
1 parent 2e2ea4c commit 053ca1d

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

.gitlab-ci.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ diff:
1414
- git diff
1515
- test -z "$(git diff 2> /dev/null)" || exit 'Files are not generated or formatted with gofumpt, issue `make generate` and commit the result'
1616
- test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit 'Generation created untracked files, cannot proceed'
17-
only:
18-
- merge_requests
19-
- branches
17+
rules:
18+
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
19+
- if: $CI_PIPELINE_SOURCE == 'push'
2020
golangci_lint:
2121
stage: lint
2222
image:
@@ -26,9 +26,9 @@ golangci_lint:
2626
- go
2727
script:
2828
- golangci-lint run --enable-all
29-
only:
30-
- merge_requests
31-
- branches
29+
rules:
30+
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
31+
- if: $CI_PIPELINE_SOURCE == 'push'
3232
lint-commit-msg:
3333
stage: lint
3434
image:
@@ -38,8 +38,8 @@ lint-commit-msg:
3838
- go
3939
script:
4040
- /check
41-
only:
42-
- merge_requests
41+
rules:
42+
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
4343
tidy:
4444
stage: lint
4545
image:
@@ -50,9 +50,9 @@ tidy:
5050
script:
5151
- go mod tidy
5252
- test -z "$(git diff 2> /dev/null)" || exit 'Go modules not tidied, issue \`go mod tidy\` and commit the result'
53-
only:
54-
- merge_requests
55-
- branches
53+
rules:
54+
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
55+
- if: $CI_PIPELINE_SOURCE == 'push'
5656
test:
5757
stage: test
5858
image:
@@ -63,6 +63,6 @@ test:
6363
script:
6464
- go build -v .
6565
- make test
66-
only:
67-
- merge_requests
68-
- branches
66+
rules:
67+
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
68+
- if: $CI_PIPELINE_SOURCE == 'push'

0 commit comments

Comments
 (0)