Skip to content

Commit 641b0a3

Browse files
docs(readme): Updated table and links and added an example (#86)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 328483e commit 641b0a3

File tree

1 file changed

+66
-25
lines changed

1 file changed

+66
-25
lines changed

README.md

+66-25
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
```
4343
<!-- prettier-ignore-end -->
4444
45-
3. Make sure to change the `channel_id` to your YouTube channel ID.
45+
3. Make sure to change the `channel_id` to [your YouTube channel ID](https://github.com/DenverCoder1/github-readme-youtube-cards/wiki/How-to-Locate-Your-Channel-ID).
4646

4747
4. The [cron expression](https://crontab.cronhub.io/) in the example above is set to run at the top of every hour. The first time, you may want to [trigger the workflow manually](https://github.com/DenverCoder1/github-readme-youtube-cards/wiki/Running-the-GitHub-Action-Manually).
4848

@@ -101,29 +101,31 @@ Check out the [Wiki](https://github.com/DenverCoder1/github-readme-youtube-cards
101101

102102
### Inputs
103103

104-
| Option | Description | Default |
105-
| --------------------- | ------------------------------------------------- | ------------------------------------------------------- |
106-
| `channel_id` | The channel ID to use for the feed | Required |
107-
| `lang` | The language for cards description text | "en" |
108-
| `comment_tag_name` | The name in the comment tag for replacing content | "YOUTUBE-CARDS" |
109-
| `youtube_api_key` | The API key to use for features marked with 🔑 | "" |
110-
| `max_videos` | The maximum number of videos to display | 6 |
111-
| `base_url` | The base URL to use for the cards | "https://ytcards.demolab.com/" |
112-
| `card_width` | The width of the SVG cards | 250 |
113-
| `background_color` | The background color of the SVG cards | "#0d1117" |
114-
| `title_color` | The color of the title text | "#ffffff" |
115-
| `stats_color` | The color of the stats text | "#dedede" |
116-
| `theme_context_light` | JSON object with light mode colors <sup>🎨</sup> | "{}" |
117-
| `theme_context_dark` | JSON object with dark mode colors <sup>🎨</sup> | "{}" |
118-
| `show_duration` 🔑 | Whether to show the duration of the videos | "false" |
119-
| `author_name` | The name of the commit author | "GitHub Actions" |
120-
| `author_email` | The email address of the commit author | "41898282+github-actions[bot]@users.noreply.github.com" |
121-
| `commit_message` | The commit message to use for the commit | "docs(readme): Update YouTube cards" |
122-
| `readme_path` | The path to the README file | "README.md" |
123-
| `output_only` | Whether to skip writing to the readme file | "false" |
124-
| `output_type` | The output syntax to use ("markdown" or "html") | "markdown" |
125-
126-
🔑 YouTube API Key required. See [Setting Up the Action with a YouTube API Key](https://github.com/DenverCoder1/github-readme-youtube-cards/wiki/Setting-Up-the-Action-with-a-YouTube-API-Key) in the wiki for more information.
104+
| Option | Description | Default |
105+
| ----------------------------- | ------------------------------------------------- | ------------------------------------------------------- |
106+
| `channel_id` | The channel ID to use for the feed <sup>📺</sup> | Required |
107+
| `lang` | The locale for views and relative time text | "en" |
108+
| `comment_tag_name` | The text in the comment tag for replacing content | "YOUTUBE-CARDS" |
109+
| `youtube_api_key` | The API key to use for features marked with 🔑 | "" |
110+
| `max_videos` | The maximum number of videos to display | 6 |
111+
| `base_url` | The base URL to use for the cards | "https://ytcards.demolab.com/" |
112+
| `card_width` | The width of the SVG cards in pixels | 250 |
113+
| `background_color` | The background color of the SVG cards | "#0d1117" |
114+
| `title_color` | The color of the title text | "#ffffff" |
115+
| `stats_color` | The color of the stats text | "#dedede" |
116+
| `theme_context_light` | JSON object with light mode colors <sup>🎨</sup> | "{}" |
117+
| `theme_context_dark` | JSON object with dark mode colors <sup>🎨</sup> | "{}" |
118+
| `show_duration` <sup>🔑</sup> | Whether to show the duration of the videos | "false" |
119+
| `author_name` | The name of the commit author | "GitHub Actions" |
120+
| `author_email` | The email address of the commit author | "41898282+github-actions[bot]@users.noreply.github.com" |
121+
| `commit_message` | The commit message to use for the commit | "docs(readme): Update YouTube cards" |
122+
| `readme_path` | The path to the Markdown or HTML file to update | "README.md" |
123+
| `output_only` | Whether to skip writing to the readme file | "false" |
124+
| `output_type` | The output syntax to use ("markdown" or "html") | "markdown" |
125+
126+
<sup>📺</sup> A Channel ID is required. See [How to Locate Your Channel ID](https://github.com/DenverCoder1/github-readme-youtube-cards/wiki/How-to-Locate-Your-Channel-ID) in the wiki for more information.
127+
128+
<sup>🔑</sup> Some features require a YouTube API key. See [Setting Up the Action with a YouTube API Key](https://github.com/DenverCoder1/github-readme-youtube-cards/wiki/Setting-Up-the-Action-with-a-YouTube-API-Key) in the wiki for more information.
127129

128130
<sup>🎨</sup> See [Setting Theme Contexts for Light and Dark Mode](https://github.com/DenverCoder1/github-readme-youtube-cards/wiki/Setting-Theme-Contexts-for-Light-and-Dark-Mode) in the wiki for more information.
129131

@@ -133,10 +135,49 @@ Check out the [Wiki](https://github.com/DenverCoder1/github-readme-youtube-cards
133135

134136
| Output | Description |
135137
| ---------- | ---------------------------------------------------------------- |
136-
| `markdown` | The generated markdown section used for updating the README file |
138+
| `markdown` | The generated Markdown or HTML used for updating the README file |
137139

138140
See [Using the Markdown as an Action Output](https://github.com/DenverCoder1/github-readme-youtube-cards/wiki/Using-the-Markdown-as-an-Action-Output) for more information.
139141

142+
### Example Workflow
143+
144+
This is an advanced example showing the available options. All options are optional except `channel_id`.
145+
146+
```yaml
147+
name: GitHub Readme YouTube Cards
148+
on:
149+
schedule:
150+
# Runs every hour, on the hour
151+
- cron: "0 * * * *"
152+
workflow_dispatch:
153+
154+
jobs:
155+
deploy:
156+
runs-on: ubuntu-latest
157+
steps:
158+
- uses: DenverCoder1/github-readme-youtube-cards@main
159+
with:
160+
channel_id: UCipSxT7a3rn81vGLw9lqRkg
161+
lang: en
162+
comment_tag_name: YOUTUBE-CARDS
163+
youtube_api_key: ${{ secrets.YOUTUBE_API_KEY }} # Configured in Actions Secrets (see Wiki)
164+
max_videos: 6
165+
base_url: https://ytcards.demolab.com/
166+
card_width: 250
167+
background_color: "#0d1117"
168+
title_color: "#ffffff"
169+
stats_color: "#dedede"
170+
theme_context_light: '{ "background_color": "#ffffff", "title_color": "#24292f", "stats_color": "#57606a" }'
171+
theme_context_dark: '{ "background_color": "#0d1117", "title_color": "#ffffff", "stats_color": "#dedede" }'
172+
show_duration: true # Requires YouTube API Key (see Wiki)
173+
author_name: GitHub Actions
174+
author_email: 41898282+github-actions[bot]@users.noreply.github.com
175+
commit_message: "docs(readme): Update YouTube cards"
176+
readme_path: README.md
177+
output_only: false
178+
output_type: markdown
179+
```
180+
140181
## Contributing
141182

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

0 commit comments

Comments
 (0)