Skip to content

Commit d2fe63c

Browse files
authored
feat: Support all Confluence Auth methods (#58)
* feat: Add support for different Confluence authentication methods. Add "confluence-authentication" input, which allows the user to provide the confluence.js authentication configuration as a JSON string * feat: Make `confluence-personal-access-token` input not required. It is deprecated in favor of the new `confluence-authentication` input. * chore(deps): Bump @telefonica/markdown-confluence-sync from 2.1.1 to 2.2.0 (Add confluence authentication option)
1 parent 7968f76 commit d2fe63c

File tree

12 files changed

+116348
-116800
lines changed

12 files changed

+116348
-116800
lines changed

.github/workflows/test-e2e.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ jobs:
4545
]
4646
confluence-url: ${{ secrets.CONFLUENCE_URL }}
4747
confluence-space-key: ${{ secrets.CONFLUENCE_SPACE_KEY }}
48-
confluence-personal-access-token: ${{ secrets.CONFLUENCE_PAT }}
48+
confluence-authentication: |
49+
{
50+
"oauth2": {
51+
"accessToken": "${{ secrets.CONFLUENCE_PAT }}"
52+
}
53+
}
4954
log-level: debug
5055

5156
test-e2e:

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
#### Deprecated
1212
#### Removed
1313

14+
## [2.3.0] - 2025-10-20
15+
16+
### Added
17+
18+
* feat: Add support for different Confluence authentication methods. Add "confluence-authentication" input, which allows the user to provide the confluence.js authentication configuration as a JSON string
19+
20+
### Changed
21+
22+
* feat: Make `confluence-personal-access-token` input not required. It is deprecated in favor of the new `confluence-authentication` input.
23+
* chore(deps): Bump @telefonica/markdown-confluence-sync from 2.1.1 to 2.2.0 (Add confluence authentication option)
24+
1425
## [2.2.1] - 2025-07-10
1526

1627
### Fixed

README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ docs/
7272
confluence-url: 'https://your.confluence.es'
7373
confluence-root-page-id: '123456789'
7474
confluence-space-key: 'YOUR-SPACE-KEY'
75-
confluence-personal-access-token: ${{ secrets.CONFLUENCE_PAT }}
75+
confluence-authentication: |
76+
{
77+
"oauth2": {
78+
"accessToken": "${{ secrets.CONFLUENCE_PAT }}"
79+
}
80+
}
7681
```
7782
7883
> [!TIP]
@@ -114,7 +119,12 @@ For example:
114119
]
115120
confluence-url: 'https://your.confluence.es'
116121
confluence-space-key: 'YOUR-SPACE-KEY'
117-
confluence-personal-access-token: ${{ secrets.CONFLUENCE_PAT }}
122+
confluence-authentication: |
123+
{
124+
"oauth2": {
125+
"accessToken": "${{ secrets.CONFLUENCE_PAT }}"
126+
}
127+
}
118128
```
119129

120130
### Flat operation mode
@@ -142,7 +152,12 @@ confluence_page_id: 123456789
142152
confluence-url: 'https://your.confluence.es'
143153
confluence-root-page-id: '123456789'
144154
confluence-space-key: 'YOUR-SPACE-KEY'
145-
confluence-personal-access-token: ${{ secrets.CONFLUENCE_PAT }}
155+
confluence-authentication: |
156+
{
157+
"oauth2": {
158+
"accessToken": "${{ secrets.CONFLUENCE_PAT }}"
159+
}
160+
}
146161
```
147162

148163
### Mermaid diagrams
@@ -179,13 +194,14 @@ The action accepts a configuration file in the root of the repository, and it ca
179194
|------|-------------|----------|---------|
180195
| `mode` | Operation mode: `tree`, `id` or `flat` | No | `tree` |
181196
| `docs-dir` | Path to the directory containing the markdown files | __Yes__ | |
182-
| `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/confluence-tools/tree/main/components/markdown-confluence-sync#filesmetadata-property) | No | |
197+
| `files-metadata` | Array of objects with the metadata of the files to sync, expressed as a 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/confluence-tools/tree/main/components/markdown-confluence-sync#filesmetadata-property) | No | |
183198
| `files-pattern` | Pattern to filter the files to sync in flat or id mode | No | |
184199
| `ignore`| Semicolon separated list of [glob](https://github.com/cowboy/node-globule) patterns to ignore files. Matches are based on the current working directory | No | |
185200
| `confluence-url` | Confluence base URL | __Yes__ | |
186201
| `confluence-root-page-id` | ID of the Confluence page under which the pages will be synchronized | __Yes__ | |
187202
| `confluence-space-key` | Key of the Confluence space where the pages will be synced | __Yes__ | |
188-
| `confluence-personal-access-token` | Confluence personal access token | __Yes__ | |
203+
| `confluence-personal-access-token` | Confluence personal access token. Deprecated. Use `confluence-authentication` instead | __No__ | |
204+
| `confluence-authentication` | Confluence authentication object expressed as a stringified JSON (supports multiline). Refer to the [confluence.js docs](https://github.com/MrRefactoring/confluence.js?tab=readme-ov-file#authentication) for more information | No | |
189205
| `confluence-root-page-name` | Customize Confluence page titles by adding a prefix to all of them for improved organization and clarity | No | |
190206
| `confluence-notice-message` | Notice message to add at the beginning of the Confluence pages | No | `<p><strong>AUTOMATION NOTICE: This page is synced automatically, changes made manually will be lost</strong></p>` |
191207
| `confluence-notice-template` | Template string to use for the notice message | No | |
@@ -212,7 +228,11 @@ module.exports = {
212228
docsDir: "docs",
213229
confluence: {
214230
url: "https://my-confluence.es",
215-
personalAccessToken: "*******",
231+
authentication: {
232+
oauth2: {
233+
accessToken: "*****"
234+
}
235+
},
216236
spaceKey: "MY-SPACE",
217237
rootPageId: "my-root-page-id"
218238
}

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ inputs:
3535
description: 'Metadata of the files to sync'
3636
type: string
3737
multiline: true
38-
required: false
3938
docs-dir:
4039
description: 'Path to the directory containing the markdown files'
4140
type: string
@@ -45,6 +44,10 @@ inputs:
4544
confluence-personal-access-token:
4645
description: 'Confluence personal access token'
4746
type: string
47+
confluence-authentication:
48+
description: 'Confluence authentication object expressed as a stringified JSON'
49+
multiline: true
50+
type: string
4851
confluence-space-key:
4952
description: 'Key of the Confluence space where the pages will be synced'
5053
type: string

0 commit comments

Comments
 (0)