Skip to content

updated agent compatibility #22374

updated agent compatibility

updated agent compatibility #22374

Workflow file for this run

name: 'URL Checker'
on: [push, pull_request]
jobs:
check_urls:
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v2.3.4
- name: Download and install Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.82.0"
extended: true
- name: Update link shortcode to error on broken links
run: sed -i 's/#ERROR/\<{{ errorf "broken link in %s" .Position }}\>/g' themes/netDocs/layouts/shortcodes/link.html
- name: Run Hugo
run: hugo
# There is a bug in the checkout module. If the output of this is too long (without head) it will cause the checkout "cleanup"
# step to fail. This will cause the action to declare a build failure.
- name: Grep for bad kb_links
run: |
echo "GREP_OUTPUT<<EOF" >> $GITHUB_ENV
grep -ro --exclude='*/pdf/index.html' --exclude="*.txt" --include='*.html' '<code>&lt;a rel=&quot;canonical&quot; href=&quot;' public/ | head -20 >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Print bad kb_links
run: echo $GREP_OUTPUT
- name: Exit != 0 if there was grep output
run: exit $(echo -n $GREP_OUTPUT | wc -m)