1# This workflow checks the links in plaintext files in the repository
2name: Check Links
3
4on:
5  # Uncomment the 'pull_request' line below to trigger the workflow in PR
6  # pull_request:
7  # Schedule runs on 12 noon every Sunday
8  schedule:
9    - cron: '0 12 * * 0'
10
11jobs:
12  check_links:
13    name: Check Links
14    runs-on: ubuntu-latest
15
16    steps:
17    - name: Checkout the repository
18      uses: actions/checkout@v2.3.4
19
20    - name: Link Checker
21      uses: lycheeverse/lychee-action@v1.1.0
22      with:
23        # 429: Too many requests
24        args: >
25          --accept 429
26          --exclude "^ftp://"
27          --exclude "^https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$"
28          --exclude "^https://download1.rpmfusion.org/free/el/rpmfusion-free-release-$"
29          --exclude "^http://maps.google.com/mapfiles/kml/$"
30          --exclude "^http://aa.usno.navy.mil/faq/docs/lawyers.php$"
31          --exclude "^uhttp://my.server.com/images$"
32          --exclude "^-W@weight.png$"
33          --exclude "^http://topex.ucsd.edu/marine_grav/mar_grav.html"
34          --exclude "^https://topex.ucsd.edu/sandwell/"
35          --exclude "^http://topex.ucsd.edu"
36          --verbose
37          "**/*.rst"
38          "**/*.rst_"
39          "**/*.md"
40      env:
41        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42
43    - name: Get current date
44      id: date
45      run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
46
47    - name: Create Issue From File
48      uses: peter-evans/create-issue-from-file@v3
49      with:
50        title: Link Checker Report on ${{ steps.date.outputs.date }}
51        content-filepath: ./lychee/out.md
52