-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from tushar5526/orphan-pages-checker
Orphan pages checker GHA
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |