mirror of
https://github.com/cupcakearmy/confluence-markdown-sync.git
synced 2025-09-05 23:30:40 +00:00
Compare commits
6 Commits
v1.0.2
...
e3c11d1f58
Author | SHA1 | Date | |
---|---|---|---|
e3c11d1f58 | |||
|
e43940725b | ||
|
a59824adbb | ||
|
090b5472c5 | ||
0d3d395931 | |||
aefcf035d8 |
14
README.md
14
README.md
@@ -27,13 +27,17 @@ jobs:
|
||||
|
||||
Uses basic auth for the rest api.
|
||||
|
||||
- `cloud`: The ID can be found by looking at your confluence domain: `https://<cloud>.atlassian.net/...`
|
||||
- `cloud`: Can be either:
|
||||
- A subdomain (`acme` for Atlassian hosted instances (e.g. `https://acme.atlassian.net`))
|
||||
- A full URL (e.g., `https://mycompany.com` for self-hosted instances)
|
||||
|
||||
- `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 posted to and look at the url. It will look something like this:
|
||||
- For Atlassian hosted: `https://<subdomain>.atlassian.net/wiki/spaces/<space>/pages/<page-id>/<title>`
|
||||
- For self-hosted: `https://<your-url>/wiki/spaces/<space>/pages/<page-id>/<title>`
|
||||
|
||||
### Using secrets
|
||||
|
||||
@@ -41,7 +45,7 @@ It's **higly reccomended** that you use secrets!
|
||||
|
||||
To use them you need them to specify them before in your repo. [Docs](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets)
|
||||
|
||||
The you can use them in any input field.
|
||||
Then you can use them in any input field.
|
||||
|
||||
```yml
|
||||
# .github/workflows/my-workflow.yml
|
||||
@@ -49,6 +53,10 @@ The you can use them in any input field.
|
||||
token: ${{ secrets.token }}
|
||||
```
|
||||
|
||||
## Known Limitations
|
||||
|
||||
For now images will not be uploaded [see ticket](https://github.com/cupcakearmy/confluence-markdown-sync/issues/5), they would require extra steps. If anyone feedls brave enough, constributions are welcomed :)
|
||||
|
||||
## Development
|
||||
|
||||
1. Clone the repo
|
||||
|
@@ -25,7 +25,13 @@ 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']}"
|
||||
base_url = envs['cloud']
|
||||
if '://' in base_url: # It's a full URL
|
||||
# Remove trailing slash if present
|
||||
base_url = base_url.rstrip('/')
|
||||
url = f"{base_url}/wiki/rest/api/content/{envs['to']}"
|
||||
else: # It's a subdomain
|
||||
url = f"https://{base_url}.atlassian.net/wiki/rest/api/content/{envs['to']}"
|
||||
|
||||
current = requests.get(url, auth=(envs['user'], envs['token'])).json()
|
||||
|
||||
|
Reference in New Issue
Block a user