Coder Social home page Coder Social logo

bangumi-action's Introduction

Bangumi.tv 收藏卡片 for Github Actions

这个 Actions 脚本可以根据你的 Bangumi.TV 的收藏,自动生成一个精美的卡片,并自动上传到 github 仓库,你可以在任何地方(你的网站、博客首页、Github首页)引用这个收藏卡片的图片链接,并且会根据你配置的 Github Actions 定时自动更新。

卡片预览效果

https://github.com/kom3ng/bangumi-action

Inputs

  • github-token

    Action Token 固定值:${{secrets.GITHUB_TOKEN}}

  • bgm-user-id

    Bangumi.TV 的用户 ID,如果你已经设置了用户名,请使用用户名,如 xiaoyvyv

  • bgm-img-path

    生成成功后,上传的当前仓库的路径,如 bgm/collection.svg 则会上传到当前仓库 bgm 文件夹下,需要以 .svg 结尾。

Github Action 使用示例

你只需要在你要使用该 Action 的仓库中,配置 bgm-user-idbgm-img-path 即可,其它可以不用动。

name: Bgm-Data-Sync
on:
  # 每日零点执行(这个配置最小间隔5分钟)
  schedule: [{ cron: '0 0 * * *' }]
  # 手动触发
  workflow_dispatch:
  # master/main 分支有提交时执行
  push: {branches: ["master", "main"]}

jobs:
  bgm-sync:
    runs-on: ubuntu-latest
    name: 每日同步BGM收藏卡片
    permissions:
      contents: write
    steps:
      - name: Bgm Collection Card
        id: bgm
        uses: Kom3ng/bangumi-action@latest
        with:
          github-token: '${{secrets.GITHUB_TOKEN}}'
          bgm-user-id: 'astrack'
          bgm-img-path: 'bgm/card.svg'
          show-animes: true
          show-games: true
          show-mangas: true
          show-characters: true

      - name: Get the output image url
        run: echo "图片生成的链接地址 ${{ steps.bgm.outputs.message }}"

bangumi-action's People

Contributors

kom3ng avatar actions-user avatar xiaoyvyv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.