diff --git a/README.md b/README.md index 4d5ec33..da13a22 100644 --- a/README.md +++ b/README.md @@ -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://.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://.atlassian.net/wiki/spaces//pages//` +- `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 diff --git a/src/main.py b/src/main.py index 7e85f12..226c097 100644 --- a/src/main.py +++ b/src/main.py @@ -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()