Skip to content

Commit 090b547

Browse files
committed
support_cloud_URLs
Instead of relying only on *.atlassian.net, modify the input to be cloudUrl so different flavours of Confluence URLs can be used (including *.jira.com).
1 parent 0d3d395 commit 090b547

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ jobs:
2727
2828
Uses basic auth for the rest api.
2929
30-
- `cloud`: The ID can be found by looking at your confluence domain: `https://<cloud>.atlassian.net/...`
30+
- `cloudUrl`: The URL (without https://) of your confluence instance. E.g: `acme.atlassian.net/...` or `acme.jira.com`
3131

3232
- `user`: The user that generated the access token
3333

3434
- `token`: You can generate the token [here](https://id.atlassian.com/manage-profile/security/api-tokens). Link to [Docs](https://confluence.atlassian.com/cloud/api-tokens-938839638.html)
3535

36-
- `to`: The page ID can be found by simply navigating to the page where you want the content to be postet to and looke at the url. It will look something like this: `https://<cloud-id>.atlassian.net/wiki/spaces/<space>/pages/<page-id>/<title>`
36+
- `to`: The page ID can be found by simply navigating to the page where you want the content to be postet to and looke at the url. It will look something like this: `https://<cloudUrl>/wiki/spaces/<space>/pages/<page-id>/<title>`
3737

3838
### Using secrets
3939

src/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
exit(1)
1616

1717
envs: Dict[str, str] = {}
18-
for key in ['from', 'to', 'cloud', 'user', 'token']:
18+
for key in ['from', 'to', 'cloudUrl', 'user', 'token']:
1919
value = environ.get(f'INPUT_{key.upper()}')
2020
if not value:
2121
print(f'Missing value for {key}')
@@ -25,7 +25,7 @@
2525
with open(join(workspace, envs['from'])) as f:
2626
md = f.read()
2727

28-
url = f"https://{envs['cloud']}.atlassian.net/wiki/rest/api/content/{envs['to']}"
28+
url = f"https://{envs['cloudUrl']}/wiki/rest/api/content/{envs['to']}"
2929

3030
current = requests.get(url, auth=(envs['user'], envs['token'])).json()
3131

0 commit comments

Comments
 (0)