File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Docs checker
2+ on :
3+ pull_request :
4+ branches :
5+ - main
6+ paths :
7+ - ' docs/**'
8+ jobs :
9+ validate-line-length :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v3
13+ with :
14+ fetch-depth : 0
15+ - name : Make sure git is installed
16+ run : apt-get update && apt-get install git -y && git --version
17+ # "https://google.com/serch"
18+
19+ # The first grep filters out everything that has a link in it. The second filters anything
20+ # that is not an addition (prefixed by a single '+').
21+ - name : Get changed file names of files changed in PR
22+ run : git diff -U0 ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -P "^(?!.*(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])).*" | grep -P "^\+{1}(?!\+)" > diff_files.txt
23+ - name : Count line lengths in diff_files.txt
24+ run : " awk -F: 'BEGIN { if(length>100) { err = 1; exit; } } END {exit err}' diff_files.txt"
You can’t perform that action at this time.
0 commit comments