Skip to content

This GitHub actions monitors issues, pull requests and related comments for a special syntax used to search for cards in the gatherer and scryfall.

License

Notifications You must be signed in to change notification settings

ldeluigi/mtg-fetch-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Mtg Card Fetch Bot

This action/workflow replies to issues, pull requests and their respective comments with smart links to Magic the Gathering resources. Uses the standard [[<card-name>]] for the default output or some other syntax that enable special features like image previews, card prices or legality info.

Current Build: build-test

Commands for the bot

You can see the syntax handbook by commenting a issue or a pull_request with !mtg help or Mtg Fetch Help.

How to use this action

Add .github/workflows/mtg-card-fetch.yml to your workflows (just copy and paste from the source).

Or use it in your own workflow that reacts to issues, pull_request, issue_comment, pull_request_review, pull_request_review_comment:

# .github/workflows/mtg-card-fetch.yml
name: Mtg Card Fetch Bot

on:
  issue_comment:
    types: [created]
  issues:
    types: [opened]
  pull_request:
    types: [opened]
  pull_request_review:
    types: [submitted]
  pull_request_review_comment:
    types: [created]

jobs:
  fetch-card-references:
    name: Fetch MTG Card
    runs-on: ubuntu-latest
    permissions:
      issues: write
      pull-requests: write
    steps:
      - uses: ldeluigi/mtg-fetch-action@v1

Quick reference

  • [[cardname]] returns card information from gatherer and other websites in the chat.
  • {{cardname}} returns card information from gatherer, and also puts the card image in the chat.
  • ::cardname:: returns card format legality information.
  • ((cardname)) returns card pricing from TCGPlayer, and also puts the card image in the chat.

If you desire a specific set image, insert e:SET inside the brackets and after the card name, using the 3 letter set code instead of the word SET. Other syntax rules can be found at https://scryfall.com/docs/syntax.