Skip to content

Commit

Permalink
Merge pull request #486 from cofinoa/resolving-issues-link-checker
Browse files Browse the repository at this point in the history
Resolving issues link checker
  • Loading branch information
cofinoa authored Apr 29, 2024
2 parents 45395b6 + d620dee commit d4a0ff5
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 328 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/check_jekyll_build.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,41 @@
#
# GitHub Actions Workflow for pull request events against the main branch to
# make sure Jekyll still builds. If successful, the resulting html files are
# uploaded as artifacts to make it easier to preview the results of a PR.
# GitHub Actions Workflow for pull request events to make sure
# Markdown links are not-broken and Jekyll still builds.
# If successful, the resulting html files are uploaded as
# artifacts to make it easier to preview the results of a PR.
#
# For more information on the actions used in this workflow, please see:
# https://github.com/actions/checkout
# https://github.com/lycheeverse/lychee-action
# https://github.com/marketplace/actions/build-jekyll
# https://github.com/actions/upload-artifact
#
name: Check Jekyll Build
name: Check markdown links and Jekyll build
on:
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, edited]
workflow_dispatch:

jobs:
# Job to test that web pages build
jekyll_build:
name: Jekyll build of web pages
check-markdown-links-build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check markdown links
uses: lycheeverse/lychee-action@v1
with:
fail: true
format: markdown
jobSummary: true
output: ./lychee/results.md
args: --config .lychee.toml './**/*.md'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Build with Jekyll
uses: nigelbritton/jekyll-build-action@v1.1
uses: actions/jekyll-build-pages@v1

- name: Upload CF Website artifact
uses: actions/upload-artifact@v4
Expand Down
59 changes: 0 additions & 59 deletions .github/workflows/check_links.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/check_links_cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# GitHub Actions Workflow to check links on CF website artifact, and reopen related issue
#
# For more information on the actions used in this workflow, please see:
# https://github.com/lycheeverse/lychee-action
# https://github.com/actions/download-artifact
# https://github.com/micalevisk/last-issue-action
# https://github.com/peter-evans/create-issue-from-file

name: Check links on CF conventions web page
on:
schedule:
- cron: '23 8 * * 1'
workflow_dispatch:

jobs:
check_links:
name: Check links # TODO: Check also Asciidoc (this should take place in https://github.com/cf-convention/cf-conventions)
runs-on: ubuntu-latest

steps:
- name: Download CF Website artifact
uses: actions/download-artifact@v4
with:
name: CF Website
path: ./_site/

- name: Check markdown links
uses: lycheeverse/lychee-action@v1
with:
fail: true
format: markdown
jobSummary: true
output: ./lychee/results.md
args: --config lychee.toml ./_site/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Find Link Checker Issue
id: link-checker-issue
uses: micalevisk/last-issue-action@v2
with:
state: open
labels: |
link-checker, report, automated issue
- name: Update Issue
uses: peter-evans/create-issue-from-file@v5
with:
title: "Broken links detected in CF Website artifact 🔗"
# Update an existing issue if one was found (issue-number),
# otherwise an empty value creates a new issue:
issue-number: "${{ steps.link-checker-issue.outputs.issue_number }}"
content-filepath: ./lychee/results.md
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
link-checker, report, automated issue
35 changes: 35 additions & 0 deletions .lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
verbose = "info"
no_progress = true
exclude = [
"cfeditor.ceda.ac.uk", # standard_name_rule, vocabularies, discussion
# "wps-web1.ceda.ac.uk",
# "http://kitt.llnl.gov/trac/wiki/SatelliteData",
# "http://cf-trac.llnl.gov/trac/",
"https://mailman.cgd.ucar.edu/pipermail/cf-metadata", # discussion, governance
# Data/cf-standard-names/
"http://glossary.ametsoc.org/wiki",
"https://www.unidata.ucar.edu/software/udunits/udunits-current/doc/udunits",
"https://www.unidata.ucar.edu/software/udunits/udunits-2.2.28/udunits2.html",
"https://www.sciencedirect.com/science/article/pii/0967063793901018",
"https://www.ipcc.ch/ipccreports/tar/wg1/273.htm",
"http://mailman.cgd.ucar.edu/mailman/listinfo/cf-metadata",
"http://gcmd.nasa.gov/Resources/valids",
#
"http://mmisw.org/ont", # faq (TIMEOUT)
"https://mmisw.org/ont", # faq (TIMEOUT)
"http://www.cgd.ucar.edu/cms/eaton/cf-metadata/clivar_article.pdf", # Data/cf-documents/cf-governance/cf2_whitepaper_final.html
"http://www.cgd.ucar.edu/cms/eaton/cf-metadata/CF-current.html", # Data/cf-documents/requirements-recommendations
"https://www.usbr.gov/lc/socal/reports/SMappend_C.pdf", # Data/area-type-table/**/build/area-type-table.html
"https://cf-trac.llnl.gov/trac/", # 2018-Workshop, 2019-Workshop
"http://mailman.cgd.ucar.edu/pipermail/cf-metadata", # 2019-Workshop
"https://www.wonder.me", # 2021-Workshop
"https://figshare.com/account/articles/24633939", # 2023-Workshop
"https://figshare.com/account/articles/24633894", # 2023-Workshop
# "https://github.com/", # Uncomment if you hit GitHub Rate Limit: https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api
]
exclude_path = [
# Jekyll post build directory (i.e. _site)
"_site/Data/cf-standard-names/docs/guidelines.html",
"_site/Data/cf-conventions/",
"_site/Data/Trac-tickets/",
]
3 changes: 0 additions & 3 deletions .lycheeignore

This file was deleted.

18 changes: 9 additions & 9 deletions Meetings/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ group: "navigation"
* [2017 Advancing netCDF-CF Workshop][2017] - 6-8 September 2017 - EarthCube - Boulder, CO (USA)
* [2016 Advancing netCDF-CF Workshop for the Geosciences][2016] - 24-26 May 2016 - EarthCube - Boulder, CO (USA)

[2024]: 2024-Workshop.html
[2023]: 2023-Workshop.html
[2022]: 2022-Workshop.html
[2021]: 2021-Workshop.html
[2020]: 2020-Workshop.html
[2019]: 2019-Workshop.html
[2018]: 2018-Workshop.html
[2017]: 2017-Workshop.html
[2016]: 2016-Workshop.html
[2024]: 2024-Workshop.md
[2023]: 2023-Workshop.md
[2022]: 2022-Workshop.md
[2021]: 2021-Workshop.md
[2020]: 2020-Workshop.md
[2019]: 2019-Workshop.md
[2018]: 2018-Workshop.md
[2017]: 2017-Workshop.md
[2016]: 2016-Workshop.md

## Other related CF meetings

Expand Down
2 changes: 1 addition & 1 deletion Training/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ group: "navigation"
Videos of presentations given at the [2022 CF training workshop][2022] are available at the [CF conventions YouTube channel][YouTube]


[2022]: 2022-Training-Workshop.html
[2022]: 2022-Training-Workshop.md
[YouTube]: https://www.youtube.com/channel/UCKLq7PCVonFJA0ec98SMFZA
Loading

0 comments on commit d4a0ff5

Please sign in to comment.