Skip to content

Commit dbd94b4

Browse files
anton-staroverovAnton Staroverovgithub-actions
authored
Feat/code embedder (#1)
* refactor: replace update-readme script with code embedder action * docs: Apply Code Embedder * feat: add code embedder workflow for README updates * Update README for Git configuration sections * Rename job from code_embedder to code-embedder * Update comment for clarity in .gitconfig.example * docs: Apply Code Embedder * Update paths in code-embedder.yml workflow * Revert "Update comment for clarity in .gitconfig.example" This reverts commit e7efb68. * docs: Apply Code Embedder * Revert "feat: add code embedder workflow for README updates" This reverts commit da6bcfe. * fix: correct paths in update-readme.yml workflow --------- Co-authored-by: Anton Staroverov <5911853+73071319+tonystar@users.noreply.github.com> Co-authored-by: github-actions <github-actions@github.com>
1 parent 6e01ca9 commit dbd94b4

3 files changed

Lines changed: 14 additions & 61 deletions

File tree

.github/workflows/update-readme.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,20 @@ name: Update README with Config Files
33
on:
44
push:
55
paths:
6+
- 'README.md'
67
- '.gitconfig.example'
78
- '.gitconfig-github'
89
- '.gitconfig-gitlab'
910
- '.github/workflows/update-readme.yml'
10-
- 'scripts/update-readme.py'
1111

1212
jobs:
13-
update-readme:
13+
code-embedder:
1414
runs-on: ubuntu-latest
1515
permissions:
1616
contents: write
1717
steps:
1818
- uses: actions/checkout@v4
1919

20-
- name: Update README with config file contents
21-
run: python3 scripts/update-readme.py
22-
23-
- name: Commit changes
24-
run: |
25-
git config user.name "github-actions[bot]"
26-
git config user.email "github-actions[bot]@users.noreply.github.com"
27-
if ! git diff --quiet HEAD; then
28-
git add README.md
29-
git commit -m "docs: update README with config file contents"
30-
git push
31-
fi
20+
- uses: kvankova/code-embedder@v1.1.3
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ You'll need the following configuration files. Replace all `PLACE_HOLDER` values
2222

2323
<!-- _The most up-to-date config version is now here: https://github.com/anydigital/git-commit-email-privacy_ -->
2424

25-
### `.gitconfig` (Global Git Configuration)
25+
### `.gitconfig`
2626

27-
<!-- GITCONFIG_EXAMPLE_START -->
28-
29-
```ini
27+
```ini:.gitconfig.example
3028
# ====================================================================
3129
# Global Git Configuration
3230
#
@@ -55,15 +53,12 @@ You'll need the following configuration files. Replace all `PLACE_HOLDER` values
5553
5654
[includeIf "hasconfig:remote.*.url:**/*gitlab.com/**"]
5755
path = .gitconfig-gitlab
58-
```
59-
60-
<!-- GITCONFIG_EXAMPLE_END -->
6156
62-
### `.gitconfig-github` (GitHub-Specific Configuration)
57+
```
6358

64-
<!-- GITCONFIG_GITHUB_START -->
59+
### `.gitconfig-github`
6560

66-
```ini
61+
```ini:.gitconfig-github
6762
# ====================================================================
6863
# GitHub-specific Git configuration
6964
#
@@ -74,15 +69,12 @@ You'll need the following configuration files. Replace all `PLACE_HOLDER` values
7469
7570
[user]
7671
email = YOUR_GITHUB_ID+USERNAME@users.noreply.github.com
77-
```
7872
79-
<!-- GITCONFIG_GITHUB_END -->
80-
81-
### `.gitconfig-gitlab` (GitLab-Specific Configuration)
73+
```
8274

83-
<!-- GITCONFIG_GITLAB_START -->
75+
### `.gitconfig-gitlab`
8476

85-
```ini
77+
```ini:.gitconfig-gitlab
8678
# ====================================================================
8779
# GitLab-specific Git configuration
8880
#
@@ -93,9 +85,8 @@ You'll need the following configuration files. Replace all `PLACE_HOLDER` values
9385
9486
[user]
9587
email = YOUR_GITLAB_ID-USERNAME@users.noreply.gitlab.com
96-
```
9788
98-
<!-- GITCONFIG_GITLAB_END -->
89+
```
9990

10091
## How to Verify
10192

scripts/update-readme.py

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

0 commit comments

Comments
 (0)