Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Workflow for displaying recent YouTube videos as SVG cards in your readme

License

NotificationsYou must be signed in to change notification settings

DenverCoder1/github-readme-youtube-cards

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

GitHub Readme YouTube Cards

Workflow for displaying recent YouTube videos as SVG cards in your readme

Basic Usage

  1. Add the following snippet to your markdown file where you want the cards to appear.
<!-- BEGIN YOUTUBE-CARDS --><!-- END YOUTUBE-CARDS -->
  1. In your repo, create a.github folder and inside create a folder namedworkflows if it does not exist. Then create a file in your.github/workflows/ folder and give it a name such asyoutube-cards.yml with the following contents.
name:GitHub Readme YouTube Cardson:schedule:# Runs every hour, on the hour    -cron:"0 * * * *"workflow_dispatch:jobs:build:runs-on:ubuntu-latest# Allow the job to commit to the repositorypermissions:contents:write# Run the GitHub Readme YouTube Cards actionsteps:      -uses:DenverCoder1/github-readme-youtube-cards@mainwith:channel_id:UCipSxT7a3rn81vGLw9lqRkg
  1. Make sure to change thechannel_id toyour YouTube channel ID.

  2. Thecron expression in the example above is set to run at the top of every hour. The first time, you may want totrigger the workflow manually.

  3. You're done! Star the repo and share it with friends! ⭐

See below foradvanced configuration.

Live Example

GitHub Star Swag Unboxing and GiveawaysHow To Self-Host GitHub Readme Streak Stats on VercelAutomatically Deploy to Fly.io with GitHub ActionsHosting a Python Discord Bot for Free with Fly.ioMaking a Wordle Clone Discord Bot with Python (Nextcord)Run Open Source Code in Seconds with GitPod

Advanced Configuration

Seeaction.yml for full details.

Check out theWiki for frequently asked questions.

Inputs

OptionDescriptionDefault
channel_idThe channel ID to use for the feed📺""
playlist_idThe playlist ID to use for the feed📺""
langThe locale for views and timestamps💬"en"
comment_tag_nameThe text in the comment tag for replacing content"YOUTUBE-CARDS"
youtube_api_keyThe API key to use for features marked with 🔑""
max_videosThe maximum number of videos to display6
base_urlThe base URL to use for the cards"https://ytcards.demolab.com/"
card_widthThe width of the SVG cards in pixels250
border_radiusThe border radius of the SVG cards5
background_colorThe background color of the SVG cards"#0d1117"
title_colorThe color of the title text"#ffffff"
stats_colorThe color of the stats text"#dedede"
theme_context_lightJSON object with light mode colors🎨"{}"
theme_context_darkJSON object with dark mode colors🎨"{}"
max_title_linesThe maximum number of lines to use for the title1
show_duration🔑Whether to show the duration of the videos"false"
author_nameThe name of the commit author"GitHub Actions"
author_emailThe email address of the commit author"41898282+github-actions[bot]@users.noreply.github.com"
commit_messageThe commit message to use for the commit"docs(readme): Update YouTube cards"
readme_pathThe path to the Markdown or HTML file to update"README.md"
output_onlyWhether to skip writing to the readme file"false"
output_typeThe output syntax to use ("markdown" or "html")"markdown"

📺 A Channel ID or Playlist ID is required. SeeHow to Locate Your Channel ID in the wiki for more information. To filter videos by type such as removing shorts or showing only popular videos, seeHow to Filter Videos by Type.

🔑 Some features require a YouTube API key. SeeSetting Up the Action with a YouTube API Key in the wiki for more information.

🎨 SeeSetting Theme Contexts for Light and Dark Mode in the wiki for more information.

💬 Seethis directory for a list of locales with the word "views" translated. The timestamps will still be translated usingBabel even if a translation file is not present. Seeissue #48 for info on contributing translations.

Outputs

OutputDescription
markdownThe generated Markdown or HTML used for updating the README file
committedWhether the action has created a commit (true orfalse)
commit_long_shaThe full SHA of the commit that has just been created
commit_shaThe short 7-character SHA of the commit that has just been created
pushedWhether the action has pushed to the remote (true orfalse)

SeeUsing the Markdown as an Action Output for more information.

Example Workflow

This is an advanced example showing the available options. All options are optional exceptchannel_id.

name:GitHub Readme YouTube Cardson:schedule:# Runs every hour, on the hour    -cron:"0 * * * *"workflow_dispatch:jobs:build:runs-on:ubuntu-latest# Allow the job to commit to the repositorypermissions:contents:write# Run the GitHub Readme YouTube Cards actionsteps:      -uses:DenverCoder1/github-readme-youtube-cards@mainwith:channel_id:UCipSxT7a3rn81vGLw9lqRkglang:encomment_tag_name:YOUTUBE-CARDSyoutube_api_key:${{ secrets.YOUTUBE_API_KEY }}# Configured in Actions Secrets (see Wiki)max_videos:6base_url:https://ytcards.demolab.com/card_width:250border_radius:5background_color:"#0d1117"title_color:"#ffffff"stats_color:"#dedede"theme_context_light:'{ "background_color": "#ffffff", "title_color": "#24292f", "stats_color": "#57606a" }'theme_context_dark:'{ "background_color": "#0d1117", "title_color": "#ffffff", "stats_color": "#dedede" }'max_title_lines:2show_duration:true# Requires YouTube API Key (see Wiki)author_name:GitHub Actionsauthor_email:41898282+github-actions[bot]@users.noreply.github.comcommit_message:"docs(readme): Update YouTube cards"readme_path:README.mdoutput_only:falseoutput_type:markdown

Example Playlist Workflow

This is an example workflow for using a playlist instead of a channel.

name:GitHub Readme YouTube Cardson:schedule:# Runs every hour, on the hour    -cron:"0 * * * *"workflow_dispatch:jobs:build:runs-on:ubuntu-latest# Allow the job to commit to the repositorypermissions:contents:write# Run the GitHub Readme YouTube Cards actionsteps:      -uses:DenverCoder1/github-readme-youtube-cards@mainwith:playlist_id:PL9YUC9AZJGFFAErr_ZdK2FV7sklMm2K0J

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request if you have a way to improve this project.

Make sure your request is meaningful and you have tested the app locally before submitting a pull request.

Please check out ourcontributing guidelines for more information on how to contribute to this project.

🙋‍♂️ Support

💙 If you like this project, give it a ⭐ and share it with friends!

YoutubeSponsor with Github

☕ Buy me a coffee

About

Workflow for displaying recent YouTube videos as SVG cards in your readme

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors20


[8]ページ先頭

©2009-2025 Movatter.jp