Skip to content

Commit 4ed8776

Browse files
authored
Merge pull request #486 from NLeSC/482-lychee-issues
Automatically create issue when links are broken in template
2 parents 977268c + e36a968 commit 4ed8776

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
name: markdown-link-check
1+
name: link-check
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- main
78
pull_request:
89
branches:
910
- main
1011
schedule:
11-
- cron: '0 0 * * 0' # every Sunday at 00:00
12+
- cron: '0 0 1 * *' # first day of every month at midnight
13+
14+
permissions:
15+
contents: read
16+
issues: write
1217

1318
jobs:
1419
linkChecker:
@@ -19,15 +24,15 @@ jobs:
1924
- name: Link Checker
2025
id: lychee
2126
uses: lycheeverse/lychee-action@v1
22-
with:
23-
# fail action if there are broken links
24-
fail: true
27+
28+
- name: Set Issue Title
29+
id: set_title
30+
run: echo "ISSUE_TITLE=Link Checker Report - $(date '+%Y-%m-%d')" >> $GITHUB_ENV
2531

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

0 commit comments

Comments
 (0)