CI: add link-checking GH action, stop failing Netlify build on link-check issues (#2504)
This commit is contained in:
		
							parent
							
								
									5ba8ae20f7
								
							
						
					
					
						commit
						4171dda4a9
					
				| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
name: Check links and refcache # cSpell:ignore refcache
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  pull_request:
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  check-formatting:
 | 
			
		||||
    name: Check links and refcache
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      - uses: actions/checkout@v3
 | 
			
		||||
 | 
			
		||||
      - run: npm install
 | 
			
		||||
      - run: npm run build
 | 
			
		||||
      - run: npm run _check:links
 | 
			
		||||
 | 
			
		||||
      - name: Fail on uncommitted refcache changes
 | 
			
		||||
        run: npm run diff:fail
 | 
			
		||||
| 
						 | 
				
			
			@ -1,9 +1,9 @@
 | 
			
		|||
[build]
 | 
			
		||||
publish = "public"
 | 
			
		||||
command = "npm run s build:preview diff:fail"
 | 
			
		||||
command = "npm run s build:preview diff:check"
 | 
			
		||||
 | 
			
		||||
[context.production]
 | 
			
		||||
command = "npm run s build:production diff:fail"
 | 
			
		||||
command = "npm run s build:production diff:check"
 | 
			
		||||
 | 
			
		||||
[[redirects]]
 | 
			
		||||
from = "https://docs.opentelemetry.io/*"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -11,6 +11,7 @@
 | 
			
		|||
    "_check:formatting": "npx prettier --check .",
 | 
			
		||||
    "_check:links": "HTMLTEST_ARGS='--log-level 1' npm run __check:links",
 | 
			
		||||
    "_check:links:internal": "npm run __check:links",
 | 
			
		||||
    "_check:links--warn": "npm run _check:links || (echo; echo 'WARNING: see link-checker output for issues.'; echo)",
 | 
			
		||||
    "_get:no": "echo SKIPPING get operation",
 | 
			
		||||
    "_get:submodule:non-lang": "npm run _get:submodule -- content-modules/opentelemetry-specification themes/docsy",
 | 
			
		||||
    "_get:submodule": "set -x && git submodule update --init ${DEPTH:- --depth 1}",
 | 
			
		||||
| 
						 | 
				
			
			@ -33,8 +34,8 @@
 | 
			
		|||
    "diff:fail": "git diff --name-only --exit-code || (echo; echo 'ERROR: the files above have changed. Locally rerun `npm run test` and commit changes'; echo; git diff | head -100; exit 1)",
 | 
			
		||||
    "get:submodule": "npm run _get:${GET:-submodule}",
 | 
			
		||||
    "make:public": "make public ls-public",
 | 
			
		||||
    "postbuild:preview": "npm run _check:links",
 | 
			
		||||
    "postbuild:production": "npm run _check:links",
 | 
			
		||||
    "postbuild:preview": "npm run _check:links--warn",
 | 
			
		||||
    "postbuild:production": "npm run _check:links--warn",
 | 
			
		||||
    "prebuild:preview": "run-s _prebuild",
 | 
			
		||||
    "prebuild:production": "run-s _prebuild check:formatting",
 | 
			
		||||
    "prebuild": "npm run _prebuild",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue