URL Validity Check #3
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: URL Validity Check | |
| on: | |
| schedule: | |
| - cron: '0 0 4 9,5,3 *' # Runs at midnight on the 4th of March and September | |
| workflow_dispatch: # Allows manual trigger | |
| jobs: | |
| check_urls: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v2 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Run URL Check | |
| env: | |
| GITHUB_API_KEY: "${{ secrets.GITHUB_TOKEN }}" | |
| GITHUB_RUN_ID: "${{ github.run_id }}" | |
| run: python scripts/auto-url-validity-check.py nfdi4bioimage/training | |
| - name: Extract Failing URLs | |
| run: | | |
| echo "Please be so kind to double-check the validity of the following urls:" > failing_urls.md | |
| grep -E '❌|⚠️' url_check_results.log >> failing_urls.md || echo "No issues found!" >> failing_urls.md | |
| - name: Create GitHub Issue | |
| if: success() | |
| uses: peter-evans/create-issue-from-file@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| title: "Check the validity of the following URLs" | |
| content-filepath: failing_urls.md |