Link Checker #1378
This file contains 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
# .github/workflows/link_checker.yml | |
name: Link Checker | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 */3 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
name: 🔍 those 🌐 🔗 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Set environment variables | |
run: | | |
if [ -n "${{ secrets.SENTRY_DSN }}" ]; then | |
echo "SENTRY_DSN=${{ secrets.SENTRY_DSN }}" >> $GITHUB_ENV | |
fi | |
- name: Set LOG_LEVEL | |
run: echo "LOG_LEVEL=${{ vars.LOG_LEVEL }}" >> $GITHUB_ENV | |
- name: Build and run | |
run: cargo run | |
- name: Verify Changed files | |
id: verify-changed-files | |
uses: tj-actions/verify-changed-files@v20 | |
with: | |
files: | | |
Archives.md | |
datasets/*.md | |
- name: Commit and Push Changes | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Updated Link Test Results | |
branch: main | |
file_pattern: | | |
Archives.md | |
datasets/*.md | |
env: | |
GIT_USER_NAME: ${{ secrets.ACTIONS_USERNAME }} | |
GIT_USER_EMAIL: ${{ secrets.ACTIONS_EMAIL }} | |
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} |