mirror of
https://github.com/cupcakearmy/confluence-markdown-sync.git
synced 2025-01-22 06:56:25 +00:00
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).
This commit is contained in:
parent
0d3d395931
commit
090b5472c5
@ -27,13 +27,13 @@ jobs:
|
||||
|
||||
Uses basic auth for the rest api.
|
||||
|
||||
- `cloud`: The ID can be found by looking at your confluence domain: `https://<cloud>.atlassian.net/...`
|
||||
- `cloudUrl`: The URL (without https://) of your confluence instance. E.g: `acme.atlassian.net/...` or `acme.jira.com`
|
||||
|
||||
- `user`: The user that generated the access token
|
||||
|
||||
- `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)
|
||||
|
||||
- `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>`
|
||||
- `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>`
|
||||
|
||||
### Using secrets
|
||||
|
||||
|
@ -15,7 +15,7 @@ if not workspace:
|
||||
exit(1)
|
||||
|
||||
envs: Dict[str, str] = {}
|
||||
for key in ['from', 'to', 'cloud', 'user', 'token']:
|
||||
for key in ['from', 'to', 'cloudUrl', 'user', 'token']:
|
||||
value = environ.get(f'INPUT_{key.upper()}')
|
||||
if not value:
|
||||
print(f'Missing value for {key}')
|
||||
@ -25,7 +25,7 @@ for key in ['from', 'to', 'cloud', 'user', 'token']:
|
||||
with open(join(workspace, envs['from'])) as f:
|
||||
md = f.read()
|
||||
|
||||
url = f"https://{envs['cloud']}.atlassian.net/wiki/rest/api/content/{envs['to']}"
|
||||
url = f"https://{envs['cloudUrl']}/wiki/rest/api/content/{envs['to']}"
|
||||
|
||||
current = requests.get(url, auth=(envs['user'], envs['token'])).json()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user