Scheduled Download Link Check #37115
This file contains hidden or 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
| name: Scheduled Download Link Check | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0-23 * * *' | |
| concurrency: | |
| group: scheduled-download-link-check-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| name: Check Download Links and Raise Issue | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Run Lychee | |
| id: lychee | |
| uses: lycheeverse/lychee-action@v2 | |
| with: | |
| args: >- | |
| --verbose https://dvc.org/ --base https://dvc.org/ --include | |
| /download/ | |
| fail: false | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Find latest open Link Check issue | |
| id: find-existing-comment | |
| run: | | |
| gh issue list -R ${{ github.repository }} --author "github-actions[bot]" -l "link-checker" --json "number" --jq ".[].number" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create or Update Issue | |
| uses: peter-evans/create-issue-from-file@v6 | |
| if: steps.lychee.outputs.exit_code != 0 | |
| with: | |
| issue-number: ${{ steps.find-existing-comment.outputs.result }} | |
| title: 'DVC Download Link Checker Report' | |
| content-filepath: ./lychee/out.md | |
| labels: link-checker | |
| - name: Close if Check Passes | |
| if: >- | |
| steps.lychee.outputs.exit_code == 0 && | |
| steps.find-existing-comment.outputs.result | |
| run: | |
| gh issue close --comment "The most recent link check passed!" "${{ | |
| steps.find-existing-comment.outputs.result }}" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |