Skip to content

Commit c8cb368

Browse files
authored
Rename space-id to space-key (#9)
1 parent 1f45c85 commit c8cb368

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
* Rename space-id to space-key ([#9](https://github.com/Bhacaz/docs-as-code-confluence/pull/9))
56
* Upload images ([#5](https://github.com/Bhacaz/docs-as-code-confluence/pull/5))
67
* Specified node version and updated dependencies ([#4](https://github.com/Bhacaz/docs-as-code-confluence/pull/4))
78

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ the directory structure.
77

88
## Parameters
99

10-
| Name | Description | Required |
11-
| ---- | --- | --- |
12-
| `folder` | The folder to sync | true |
13-
| `username` | Confluence username or email | true |
14-
| `password` | Confluence password or [API token](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) | true |
10+
| Name | Description | Required |
11+
|-----------------------| --- | --- |
12+
| `folder` | The folder to sync | true |
13+
| `username` | Confluence username or email | true |
14+
| `password` | Confluence password or [API token](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/) | true |
1515
| `confluence-base-url` | Your Confluence URL (with `wiki`). Example: `https://mydomain.atlassian.net/wiki` | true |
16-
| `space-id` | Confluence **space key** to publish the documentation. Located after `spaces` in the URL. `https://mydomain.atlassian.net/wiki/spaces/<<~1234>>`. <br> Or in _Space settings_ > _Space details_ > _Key_. | true |
17-
| `parent-page-id` | Page id under which the documentation will be published. Located after `pages` in the URL. `https://mydomain.atlassian.net/wiki/spaces/~1234/pages/<<1234>>/My+Parent+Page` | true |
16+
| `space-key` | Confluence space key to publish the documentation. Located after `spaces` in the URL. `https://mydomain.atlassian.net/wiki/spaces/<<~1234>>`. <br> Or in _Space settings_ > _Space details_ > _Key_. | true |
17+
| `parent-page-id` | Page id under which the documentation will be published. Located after `pages` in the URL. `https://mydomain.atlassian.net/wiki/spaces/~1234/pages/<<1234>>/My+Parent+Page` | true |
1818

1919
## TODO
2020

@@ -48,7 +48,7 @@ jobs:
4848
username: abc@xyz.com
4949
password: ${{ secrets.API_TOKEN }}
5050
confluence-base-url: https://mydomain.atlassian.net/wiki
51-
space-id: ~1234
51+
space-key: ~1234
5252
parent-page-id: 123456789
5353
```
5454

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ inputs:
1717
confluence-base-url:
1818
description: "Your Confluence url"
1919
required: true
20-
space-id:
21-
description: "Confluence space id to publish the documentation"
20+
space-key:
21+
description: "Confluence space key to publish the documentation"
2222
required: true
2323
parent-page-id:
2424
description: "Page id under which the documentation will be published"

confluence.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
class SyncConfluence {
2-
constructor(confluenceApi, spaceId) {
3-
this.spaceId = spaceId;
2+
constructor(confluenceApi, spaceKey) {
3+
this.spaceKey = spaceKey;
44
this.confluenceApi = confluenceApi;
55
}
66

77
getPageIdByTitle(title) {
88
return new Promise((resolve) => {
99
this.confluenceApi.getContentByPageTitle(
10-
this.spaceId,
10+
this.spaceKey,
1111
title,
1212
(err, data) => {
1313
if (err) {
@@ -37,7 +37,7 @@ class SyncConfluence {
3737
createEmptyParentPage(title, parentId) {
3838
return new Promise((resolve) => {
3939
this.confluenceApi.postContent(
40-
this.spaceId,
40+
this.spaceKey,
4141
title,
4242
"",
4343
parentId,
@@ -55,7 +55,7 @@ class SyncConfluence {
5555
putContent(pageId, title, content) {
5656
this.getPageVersion(pageId, (version) => {
5757
this.confluenceApi.putContent(
58-
this.spaceId,
58+
this.spaceKey,
5959
pageId,
6060
version + 1,
6161
title,
@@ -74,7 +74,7 @@ class SyncConfluence {
7474
getAttachments(pageId) {
7575
return new Promise((resolve) => {
7676
this.confluenceApi.getAttachments(
77-
this.spaceId,
77+
this.spaceKey,
7878
pageId,
7979
(err, data) => {
8080
if (err) {
@@ -94,7 +94,7 @@ class SyncConfluence {
9494
updateAttachment(pageId, attachmentId, source) {
9595
return new Promise((resolve) => {
9696
this.confluenceApi.updateAttachmentData(
97-
this.spaceId,
97+
this.spaceKey,
9898
pageId,
9999
attachmentId,
100100
source,
@@ -116,7 +116,7 @@ class SyncConfluence {
116116
uploadAttachment(pageId, source) {
117117
return new Promise((resolve) => {
118118
this.confluenceApi.createAttachment(
119-
this.spaceId,
119+
this.spaceKey,
120120
pageId,
121121
source,
122122
(err, data) => {

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const parser = require("node-html-parser")
77
const path = require('path')
88

99
const root = "./" + core.getInput("folder", { required: true }) + "/";
10-
const spaceId = core.getInput("space-id", { required: true });
10+
const spaceKey = core.getInput("space-key", { required: true });
1111
const rootParentPageId = core.getInput("parent-page-id", { required: true });
1212

1313
const config = {
@@ -19,7 +19,7 @@ const config = {
1919
const confluenceAPI = new Confluence(config);
2020
const syncConfluence = new SyncConflence(
2121
confluenceAPI,
22-
spaceId,
22+
spaceKey,
2323
rootParentPageId
2424
);
2525

0 commit comments

Comments
 (0)