Skip to content

Commit

Permalink
Merge pull request #486 from NLeSC/482-lychee-issues
Browse files Browse the repository at this point in the history
Automatically create issue when links are broken in template
  • Loading branch information
lyashevska authored Aug 21, 2024
2 parents 977268c + e36a968 commit 4ed8776
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
name: markdown-link-check
name: link-check

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * 0' # every Sunday at 00:00
- cron: '0 0 1 * *' # first day of every month at midnight

permissions:
contents: read
issues: write

jobs:
linkChecker:
Expand All @@ -19,15 +24,15 @@ jobs:
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
with:
# fail action if there are broken links
fail: true

- name: Set Issue Title
id: set_title
run: echo "ISSUE_TITLE=Link Checker Report - $(date '+%Y-%m-%d')" >> $GITHUB_ENV

- name: Create Issue From File
# create issues only when triggered by schedule
if: github.event_name == 'schedule' && env.lychee_exit_code != 0
if: env.lychee_exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
title: ${{ env.ISSUE_TITLE }}
content-filepath: ./lychee/out.md
labels: report, automated issue

0 comments on commit 4ed8776

Please sign in to comment.