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: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
16
16
#### Deprecated
17
17
#### Removed
18
18
19
+
## [1.1.0] - 2025-01-29
20
+
21
+
### Added
22
+
23
+
* feat: Add `files-metadata` input. It allows the user to provide a JSON array with the metadata of the files to be synchronized. This way, the user can set the Confluence id, title, and if the file should be synchronized or not without the need to add frontmatter to the markdown files.
24
+
* feat: Support `id` mode. It allows the user to provide a list of files to be synchronized only by their Confluence id.
25
+
26
+
### Changed
27
+
28
+
* chore(deps): Bump @tid-xcut/markdown-confluence-sync from 1.0.0 to 1.1.0 (Add id mode and filesMetadata option)
Copy file name to clipboardExpand all lines: README.md
+48-8Lines changed: 48 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ This action syncs markdown files to Confluence using the [Markdown Confluence Sy
16
16
-[Markdown files to sync](#markdown-files-to-sync)
17
17
-[Tree operation mode](#tree-operation-mode)
18
18
-[Flat operation mode](#flat-operation-mode)
19
+
-[Id operation mode](#id-operation-mode)
19
20
-[Configuration](#configuration)
20
21
-[Inputs](#inputs)
21
22
-[Configuration file](#configuration-file)
@@ -30,19 +31,19 @@ This action syncs markdown files to Confluence using the [Markdown Confluence Sy
30
31
* Supports Mermaid diagrams
31
32
* Per-page configuration using [frontmatter metadata](https://jekyllrb.com/docs/front-matter/)
32
33
* Works great with [Docusaurus](https://docusaurus.io/)
33
-
*Two modes of operation:
34
+
*Three modes of operation:
34
35
***tree**: Mirrors the hierarchical pages structure from given folder under a Confluence root page
35
-
***flat**: Synchronize a list of markdown files matched by a [glob pattern](https://github.com/isaacs/node-glob#glob-primer)as children page of a Confluence root page, without any hierarchy.
36
-
* As an extra in this mode, a Confluence id can be provided to each page using frontmatter, and, in such case, the corresponding Confluence page will be updated, no matter if it is a child of the root page or not.
37
-
36
+
***id**: Synchronize a list of markdown files matched by a [glob pattern](https://github.com/isaacs/node-glob#glob-primer)directly to specific Confluence pages using the Confluence id provided in the frontmatter metadata or in the configuration file.
37
+
***flat**: Synchronize a list of markdown files matched by a [glob pattern](https://github.com/isaacs/node-glob#glob-primer) as children page of a Confluence root page, without any hierarchy. It is also possible to provide a Confluence id to some pages to update them directly, as in the id mode.
38
+
38
39
> [!NOTE]
39
40
> Read the [Markdown Confluence Sync library documentation](https://github.com/Telefonica/cross-confluence-tools/tree/main/components/markdown-confluence-sync) for detailed information about all features and configuration options.
40
41
41
42
## Usage
42
43
43
44
### Markdown files to sync
44
45
45
-
First of all, your markdown files must have a frontmatter metadata block at the beginning of the file. This metadata block must be in YAML format and must contain at least the `title` and the `sync_to_confluence` fields. The `sync_to_confluence` field must be set to `true` to indicate that the page should be synchronized with Confluence.
46
+
All the markdown files to be synced must have frontmatter properties "title" and "sync_to_confluence" set to true (unless you are using the `files-metadata` option). For example:
46
47
47
48
```markdown
48
49
---
@@ -81,11 +82,49 @@ docs/
81
82
> [!TIP]
82
83
> Read the [tree mode docs](https://github.com/Telefonica/cross-confluence-tools/tree/main/components/markdown-confluence-sync#tree-mode) for further information about configuration options and how to organize your markdown files.
83
84
85
+
### Id operation mode
86
+
87
+
If you want to update only specific pages directly by providing their id, you can use the id mode. In this mode, you don't need to provide a root page id. Each page in the list must have an id, and the library will update the corresponding Confluence page having the id provided. Note that the pages to update must exist in Confluence before running the sync process.
88
+
89
+
This mode is very useful when you want to update only a few pages, such as the README.md or the CHANGELOG.md files.
90
+
91
+
> [!TIP]
92
+
> Use the `files-metadata` option to provide the data of the files to sync without having to modify the markdown files themselves.
You should use __flat__ mode in case your markdown files are not organized in a hierarchical structure and you want to synchronize all of them as children of a Confluence root page.
87
126
88
-
As an extra in this mode, a Confluence id can be provided to each page using frontmatter, and, in such case, the corresponding Confluence page will be updated, no matter if it is a child of the root page or not.
127
+
As an extra in this mode, a Confluence id can be provided to some pages, as in the "id mode", to update them directly.
89
128
90
129
For example:
91
130
@@ -124,9 +163,10 @@ The action accepts a configuration file in the root of the repository, and it ca
124
163
125
164
| Name | Description | Required | Default |
126
165
|------|-------------|----------|---------|
127
-
| `mode` | Operation mode: `tree` or `flat` | No | `tree` |
166
+
| `mode` | Operation mode: `tree`, `id` or `flat` | No | `tree` |
128
167
| `docs-dir` | Path to the directory containing the markdown files | __Yes__ | |
129
-
| `files-pattern` | Pattern to filter the files to sync in flat mode | No | |
168
+
| `files-metadata` | Array of objects with the metadata of the files to sync, expressed as an stringified JSON (supports multiline). Each object must have at least the `path` property for identifying the file. For the rest of properties read the [markdown-confluence-sync docs](https://github.com/Telefonica/cross-confluence-tools/tree/main/components/markdown-confluence-sync#filesmetadata-property) | No | |
169
+
| `files-pattern` | Pattern to filter the files to sync in flat or id mode | No | |
130
170
| `confluence-url` | Confluence base URL | __Yes__ | |
131
171
| `confluence-root-page-id` | ID of the Confluence page under which the pages will be synchronized | __Yes__ | |
132
172
| `confluence-space-key` | Key of the Confluence space where the pages will be synced | __Yes__ | |
0 commit comments