diff --git a/.github/workflows/check_links.yml b/.github/workflows/check_links.yml new file mode 100644 index 0000000..f7a7d16 --- /dev/null +++ b/.github/workflows/check_links.yml @@ -0,0 +1,48 @@ +name: Picture Health + +on: + pull_request: + # Default events are opened, synchronized or reopened + workflow_dispatch: + schedule: + # Runs at the start of each month (UTC) + - cron: '0 0 1 * *' + +jobs: + check_urls: + # Do not run the scheduled workflow on forks + if: ( github.event_name != 'schedule' || github.repository_owner == 'Cockatrice' ) + + name: Check image links + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up lychee cache + uses: actions/cache@v3 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + + # Extract and check URLs directly from tokens.xml + - name: Check tokens.xml URLs + uses: lycheeverse/lychee-action@v1.5.1 + if: always() + continue-on-error: true + with: + args: '--no-progress --require-https --cache --max-cache-age 1h -- tokens.xml' + fail: true + jobSummary: true + + # Extract and check URLs directly from challenge_tokens.xml + - name: Check challenge_tokens.xml URLs + uses: lycheeverse/lychee-action@v1.5.1 + if: always() + continue-on-error: true + with: + args: '--no-progress --require-https --cache --max-cache-age 1h -- challenge_tokens.xml' + fail: true + jobSummary: true diff --git a/README.md b/README.md index eea35de..36e868a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Discord](https://img.shields.io/discord/314987288398659595?label=Discord&logo=discord&logoColor=white)](https://discord.gg/3Z9yzmA) [![Gitter Chat](https://img.shields.io/gitter/room/Cockatrice/Magic-Spoiler)](https://gitter.im/Cockatrice/Magic-Spoiler) -Magic-Token [![](https://img.shields.io/badge/dynamic/xml.svg?label=version&url=https%3A%2F%2Fraw.githubusercontent.com%2FCockatrice%2FMagic-Token%2Fmaster%2Ftokens.xml&query=%2F%2FsourceVersion)](https://github.com/Cockatrice/Magic-Token/blob/master/tokens.xml) +Magic-Token [![](https://img.shields.io/badge/dynamic/xml.svg?label=version&url=https%3A%2F%2Fraw.githubusercontent.com%2FCockatrice%2FMagic-Token%2Fmaster%2Ftokens.xml&query=%2F%2FsourceVersion)](https://github.com/Cockatrice/Magic-Token/blob/master/tokens.xml) [![Picture Health](https://github.com/Cockatrice/Magic-Token/actions/workflows/check_links.yml/badge.svg?branch=master)](https://github.com/Cockatrice/Magic-Token/actions/workflows/check_links.yml?query=branch%3Amaster) ================= This repo contains token information in [Cockatrice](https://github.com/cockatrice/cockatrice)'s [XML card database format](https://github.com/Cockatrice/Cockatrice/wiki/Custom-Cards-&-Sets#to-add-your-own-custom-cards-follow-these-steps) for Magic: The Gathering.