-
Notifications
You must be signed in to change notification settings - Fork 6
40 lines (35 loc) · 1.65 KB
/
01-check-url.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Check Broken Links
on:
schedule:
- cron: '0 10 1,15 * *' # Run on 1st and 15th days of every month at 10:00 UTC
workflow_dispatch: # Allow manual triggering of the workflow
jobs:
check_links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Close Existing Broken Links Issue(s)
uses: actions/stale@v8
with:
repo-token: ${{secrets.GITHUB_TOKEN}}
# Broken link issues are automatically created with the "automated issue" and "Broken links" labels, so we only care about closing those.
only-issue-labels: automated issue,Broken links
ignore-issue-updates: true
# close-issue-message requires permission `issues: write`
close-issue-message: 'This issue is `stale` and has been closed due to a new "Check Broken Links" run. If any links are still broken, they will be reported in a new issue: https://github.com/osmosis-labs/osmosis/issues?q=is%3Aissue+is%3Aopen+label%3A%22automated+issue%22+label%3A%22Broken+links%22'
days-before-issue-stale: 0
days-before-issue-close: 0
- name: Link Checker
id: lychee
uses: lycheeverse/[email protected]
with:
args: --exclude-loopback --verbose --no-progress './**/*.md' './**/*.html'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Create Issue From File
if: env.lychee_exit_code != 0
uses: peter-evans/create-issue-from-file@v4
with:
title: Broken Links Detected
content-filepath: ./lychee/out.md
labels: report, automated issue, Good first issue, Help wanted, Broken links