-
Notifications
You must be signed in to change notification settings - Fork 29
24 lines (23 loc) · 986 Bytes
/
docs-checker.yml
File metadata and controls
24 lines (23 loc) · 986 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
name: Docs checker
on:
pull_request:
branches:
- main
paths:
- 'docs/**'
jobs:
validate-line-length:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Make sure git is installed
run: sudo apt-get update && sudo apt-get install git -y && git --version
# "https://google.com/serch"
# The first grep filters out everything that has a link in it. The second filters anything
# that is not an addition (prefixed by a single '+').
- name: Get changed file names of files changed in PR
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
- name: Count line lengths in diff_files.txt
run: "awk -F: '{ if(length>100) { err = 1; exit err; } }' diff_files.txt"