UNCLASSIFIED - NO CUI
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bigbang
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Big Bang
bigbang
Merge requests
!141
Add commitlint job
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add commitlint job
commitlint-ci
into
master
Overview
0
Commits
9
Pipelines
53
Changes
3
Merged
Zachariah Dzielinski
requested to merge
commitlint-ci
into
master
4 years ago
Overview
0
Commits
9
Pipelines
53
Changes
3
Expand
0
0
Merge request reports
Compare
master
version 27
68d862ec
4 years ago
version 26
68d862ec
4 years ago
version 25
71deb189
4 years ago
version 24
9aff3b19
4 years ago
version 23
662e7fb7
4 years ago
version 22
87638630
4 years ago
version 21
b5131cff
4 years ago
version 20
a519b846
4 years ago
version 19
8831807b
4 years ago
version 18
c498c32a
4 years ago
version 17
c293e6f1
4 years ago
version 16
5a3741f7
4 years ago
version 15
354aaaaf
4 years ago
version 14
3c027a5b
4 years ago
version 13
8ce4e407
4 years ago
version 12
2efc8c84
4 years ago
version 11
a6dc1729
4 years ago
version 10
2a084178
4 years ago
version 9
b7d47c33
4 years ago
version 8
f54b9a05
4 years ago
version 7
34d23c50
4 years ago
version 6
37912f67
4 years ago
version 5
234edbfb
4 years ago
version 4
2ad8befd
4 years ago
version 3
142857fb
4 years ago
version 2
8cb59253
4 years ago
version 1
e18c4648
4 years ago
master (base)
and
latest version
latest version
68d862ec
9 commits,
4 years ago
version 27
68d862ec
9 commits,
4 years ago
version 26
68d862ec
9 commits,
4 years ago
version 25
71deb189
6 commits,
4 years ago
version 24
9aff3b19
5 commits,
4 years ago
version 23
662e7fb7
4 commits,
4 years ago
version 22
87638630
3 commits,
4 years ago
version 21
b5131cff
2 commits,
4 years ago
version 20
a519b846
1 commit,
4 years ago
version 19
8831807b
3 commits,
4 years ago
version 18
c498c32a
2 commits,
4 years ago
version 17
c293e6f1
1 commit,
4 years ago
version 16
5a3741f7
22 commits,
4 years ago
version 15
354aaaaf
21 commits,
4 years ago
version 14
3c027a5b
16 commits,
4 years ago
version 13
8ce4e407
15 commits,
4 years ago
version 12
2efc8c84
14 commits,
4 years ago
version 11
a6dc1729
13 commits,
4 years ago
version 10
2a084178
12 commits,
4 years ago
version 9
b7d47c33
11 commits,
4 years ago
version 8
f54b9a05
10 commits,
4 years ago
version 7
34d23c50
9 commits,
4 years ago
version 6
37912f67
8 commits,
4 years ago
version 5
234edbfb
7 commits,
4 years ago
version 4
2ad8befd
6 commits,
4 years ago
version 3
142857fb
5 commits,
4 years ago
version 2
8cb59253
4 commits,
4 years ago
version 1
e18c4648
3 commits,
4 years ago
3 files
+
67
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
scripts/commitlint.sh
0 → 100755
+
35
−
0
Options
#!/usr/bin/env bash
# store failure
failure
=
false
# debug output
echo
"Linting all commits between
$CI_DEFAULT_BRANCH
and
$CI_COMMIT_REF_NAME
"
echo
"--------------------------------------------------------"
# loop over commit sha's for commits that exist in this branch but not the default branch
for
sha
in
$(
git log origin/
$CI_DEFAULT_BRANCH
..origin/
$CI_COMMIT_REF_NAME
--format
=
format:%H
)
;
do
# get the commit message from the sha
message
=
$(
git log
--format
=
format:%s
-n
1
$sha
)
# debug output sha and message
echo
"Linting commit:
$sha
-
$message
"
# lint message and store possible failure
if
!
echo
"
$message
"
| npx commitlint
;
then
failure
=
true
;
fi
done
# if we have a failure
if
$failure
;
then
# guide developer to resolution
echo
"--------------------------------------------------------"
echo
"You have commits that have failed linting because their content does not follow conventional standards"
echo
"You must rebase, squash, or amend; and implement conventional standards on all commits for this branch"
echo
"Commit standards guide - https://www.conventionalcommits.org/"
echo
"--------------------------------------------------------"
echo
"Quick tip - Squash commits for
$CI_COMMIT_REF_NAME
"
echo
"> git checkout
$CI_COMMIT_REF_NAME
"
echo
"> git reset
\$
(git merge-base
$CI_DEFAULT_BRANCH
\$
(git rev-parse --abbrev-ref HEAD))"
echo
"> git add -A"
echo
"> git commit -m
\"
feat: example conventional commit
\"
"
echo
"> git push --force"
exit
1
fi
\ No newline at end of file
Loading