Check links on CF conventions web page #11
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
# | |
# 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 | |
# https://github.com/marketplace/actions/create-or-update-comment | |
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: Checkout | |
uses: actions/checkout@v4 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
- name: Check CF site's links | |
id: check-links | |
uses: lycheeverse/lychee-action@v1 | |
with: | |
fail: true | |
format: markdown | |
jobSummary: true | |
output: .lychee/results.md | |
args: --config .lychee/config.toml ./_site/ | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Find the last report issue | |
if: ${{ always() }} | |
id: last-issue | |
uses: micalevisk/last-issue-action@v2 | |
with: | |
state: open | |
# Find the last updated open issue that has these labels: | |
labels: | | |
defect, link-checker, report, automated issue | |
- name: On failure create issue if missing | |
if: ${{ failure() && steps.last-issue.outputs.has-found == 'false' }} | |
uses: peter-evans/create-issue-from-file@v5 | |
with: | |
title: "Broken links detected in CF Website" | |
content-filepath: .lychee/results.md | |
token: ${{ secrets.GITHUB_TOKEN }} | |
labels: | | |
defect, link-checker, report, automated issue | |
- name: On failure add comment to issue if exist | |
if: ${{ always() && steps.last-issue.outputs.has-found == 'true' }} | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
issue-number: ${{ steps.last-issue.outputs.issue-number }} | |
body-path: .lychee/results.md | |
token: ${{ secrets.GITHUB_TOKEN }} | |