Skip to content

Commit

Permalink
Merge pull request #159 from tushar5526/orphan-pages-checker
Browse files Browse the repository at this point in the history
Orphan pages checker GHA
  • Loading branch information
joewxboy authored Feb 18, 2022
2 parents 02fbc80 + a2c1e31 commit e4ad628
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/report-orphan-pages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Orphan Pages
labels: housekeeping
assignees: ''
---

## Orphan pages

Orphan pages :coffin: found on {{ env.URL }}


[View Results]({{ env.LOG_URL }})
41 changes: 41 additions & 0 deletions .github/workflows/orphan_pages_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Orphan pages checker

on:
schedule:
- cron: '0 1 1 * *'
workflow_dispatch:

env:
URL: https://open-horizon.github.io/
ISSUE_TEMPLATE: ".github/ISSUE_TEMPLATE/report-orphan-pages.md"

jobs:
checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6 # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- run: |
bundle exec jekyll serve >/dev/null 2>&1 &
pid=$!
printf "Starting the server"
until $(curl --output /dev/null --silent --head --fail 127.0.0.1:4000); do
printf '.'
sleep 5
done
printf "\nCrawling the locally hosted website\n"
wget -mpE 127.0.0.1:4000 >/dev/null 2>&1 || true
kill -15 $pid
printf "Killed the Server\n"
printf "Finding Orphan Pages\n"
diff -qr 127.0.0.1\:4000/ ./_site | grep Only | grep .html
- name: Creating issue
uses: JasonEtco/create-an-issue@v2.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOG_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}?check_suite_focus=true
with:
filename: ${{ env.ISSUE_TEMPLATE }}

0 comments on commit e4ad628

Please sign in to comment.