-
Notifications
You must be signed in to change notification settings - Fork 26
28 lines (26 loc) · 868 Bytes
/
pattern-guard.yml
File metadata and controls
28 lines (26 loc) · 868 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
25
26
27
28
name: Pattern Guard
on:
push:
branches: [ main ]
paths:
- 'docs/**'
- '.github/workflows/pattern-guard.yml'
pull_request:
paths:
- 'docs/**'
jobs:
guard:
runs-on: ubuntu-latest
steps:
- name: Start timer
run: echo "START=$EPOCHSECONDS" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Disallow relative_url | absolute_url chain in docs/
run: |
! rg -n "\|\s*relative_url\s*\|\s*absolute_url" docs || (echo "Found disallowed relative_url|absolute_url chain" && exit 1)
- name: Disallow double baseurl in paths
run: |
! rg -n "/repo_posts/repo_posts/" docs || (echo "Found duplicated baseurl in path" && exit 1)
- name: Job runtime
if: always()
run: echo "Job runtime: $(( (EPOCHSECONDS-START+59)/60 )) min" >> $GITHUB_STEP_SUMMARY