Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e2f293d

Browse files
authoredOct 27, 2024··
feat: Scan all markdown files by default
2 parents e905f91 + 1ecce0b commit e2f293d

File tree

6 files changed

+5
-120
lines changed

6 files changed

+5
-120
lines changed
 

‎.github/test_README.md

Lines changed: 0 additions & 83 deletions
This file was deleted.

‎.github/test_empty_README.md

Whitespace-only changes.

‎.github/workflows/test_code_embedder.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Seamlessly update code snippets in your **README** files! 🔄📝🚀
1111

1212
## 📚 Description
1313

14-
**Code Embedder** is a GitHub Action that automatically updates code snippets in your `README` files. It finds code blocks in your `README` that reference specific scripts, then replaces these blocks with the current content of those scripts. This keeps your documentation in sync with your code.
14+
**Code Embedder** is a GitHub Action that automatically updates code snippets in your markdown (`README`) files. It finds code blocks in your `README` that reference specific scripts, then replaces these blocks with the current content of those scripts. This keeps your documentation in sync with your code.
1515

1616
**Key features**
1717
- 🔄 **Automatic synchronization**: Keep your `README` code examples up-to-date without manual intervention.
@@ -22,7 +22,7 @@ By using **Code Embedder**, you can focus on writing and updating your actual co
2222

2323
## 🔍 How it works
2424

25-
The action looks for the following sections in the `README` file:
25+
The action looks for the following sections in the all markdown (`README`) files:
2626
````md
2727
```language:path/to/script
2828
```
@@ -78,18 +78,14 @@ jobs:
7878

7979
- name: Run code embedder
8080
uses: kvankova/code-embedder@v0.2.0
81-
with:
82-
readme_paths: README.md README2.md
8381
env:
8482
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8583

8684
```
8785
You need to create a secret with write and repo permissions in the repository settings to pass it as `GITHUB_TOKEN` in the workflow.
8886

89-
Use the `readme_paths` input to specify which README files to update. Multiple files can be listed with spaces (e.g. `README.md README2.md`). By default, only `README.md` in the root directory is updated.
90-
9187
## 🔬 Under the hood
9288
This action performs the following steps:
93-
1. 🔎 Scans through the `README` files to identify referenced script files.
94-
1. 📝 Extracts the contents from those script files and updates the corresponding code blocks in the `README` files.
89+
1. 🔎 Scans through the markdown (`README`) files to identify referenced script files.
90+
1. 📝 Extracts the contents from those script files and updates the corresponding code blocks in the markdown (`README`) files.
9591
1. 🚀 Commits and pushes the updated documentation back to the repository.

‎action.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ branding:
55
icon: "code"
66
color: "blue"
77

8-
inputs:
9-
readme_paths:
10-
description: "Path(s) to Readme file(s). Can be a single path or a list of paths. By default, it finds it in the root."
11-
required: false
12-
default: "README.md"
13-
148
runs:
159
using: docker
1610
image: Dockerfile
17-
args:
18-
- ${{ inputs.readme_paths }}

‎entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ git config --global user.name "github-actions"
44
git config --global user.email "github-actions@github.com"
55
git remote set-url origin https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git
66

7-
README_PATHS=$1
7+
README_PATHS=$(find . -name "*.md" -print)
88

99
BRANCH_NAME=${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}
1010

0 commit comments

Comments
 (0)
Please sign in to comment.