You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/docs/check_readme.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Verifies that the main `README.md` is updated when new integrations are added.
4
4
5
5
## Overview
6
6
7
-
When a new integration is added to the repository, the main `README.md` must also be updated to include the new integration in the integrations table. This script detects whether new files have been added within an integration directory and checks whether `README.md` was also modified in the same changeset.
7
+
When a new integration is added to the repository, the main `README.md` must also be updated to include the new integration in the integrations table. This script detects whether a new `config.json` has been added within an integration directory (indicating a brand-new integration) and checks whether `README.md` was also modified in the same changeset.
8
8
9
9
This check only makes sense in the context of a pull request, where there is a clear base ref to compare against.
10
10
@@ -50,7 +50,7 @@ flowchart TD
50
50
B --> C{Directory exists?}
51
51
C -->|No| B
52
52
C -->|Yes| D[git diff --diff-filter=A: find newly added files in dir]
53
-
D --> E{New files found?}
53
+
D --> E{config.json added?}
54
54
E -->|No| B
55
55
E -->|Yes| F{README.md changed?}
56
56
F -->|Yes| B
@@ -67,7 +67,7 @@ flowchart TD
67
67
2. For each given integration directory:
68
68
a. Skip if the directory doesn't exist
69
69
b. Check if any files were **newly added** (`--diff-filter=A`) within that directory
70
-
c. If new files exist**and**`README.md` was **not** changed → report an error
70
+
c. If `config.json` was newly added (i.e. it's a brand-new integration)**and**`README.md` was **not** changed → report an error
71
71
3. Exit with code 1 if any errors were found, 0 otherwise
72
72
73
73
### Key Git Commands
@@ -77,7 +77,7 @@ flowchart TD
77
77
|`git diff --name-only <base> HEAD \| grep "^README\.md$"`| Check if root README.md was modified |
78
78
|`git diff --name-only --diff-filter=A <base> HEAD \| grep "^<dir>/"`| Find newly added files in a specific directory |
79
79
80
-
The `--diff-filter=A` flag is important: it only shows **A**dded files, not modified ones. This means the check only triggers for _new_ integrations, not updates to existing ones.
80
+
The `--diff-filter=A` flag is important: it only shows **A**dded files, not modified ones. Within those added files, the script specifically looks for `config.json` — its presence signals a brand-new integration. This means adding new files to an existing integration (e.g. unit test files) does not trigger the check.
81
81
82
82
## Output Format
83
83
@@ -110,8 +110,9 @@ The `--diff-filter=A` flag is important: it only shows **A**dded files, not modi
110
110
| Scenario | Behavior |
111
111
|----------|----------|
112
112
| Only existing files modified in integration dir | ✅ Passes (no new files detected) |
113
-
| New files added and README.md updated | ✅ Passes |
114
-
| New files added but README.md NOT updated | ❌ Fails |
113
+
| New files added to existing integration (e.g. test files) | ✅ Passes (no `config.json` added) |
114
+
| New integration added and README.md updated | ✅ Passes |
115
+
| New integration added but README.md NOT updated | ❌ Fails |
115
116
| Directory argument doesn't exist on disk | Skipped silently |
116
117
| No arguments provided | Exits with code 2 (usage error) |
0 commit comments