how to handle secrets

This commit is contained in:
cupcakearmy 2020-12-13 16:53:08 +01:00
parent cfffad00ba
commit bfd4cdc043
No known key found for this signature in database
GPG Key ID: 81C683415BBD86B0

View File

@ -21,7 +21,6 @@ jobs:
cloud: <my-confluence-cloud-id> cloud: <my-confluence-cloud-id>
user: <my.user@example.org> user: <my.user@example.org>
token: <my-token> token: <my-token>
``` ```
## Authentication ## Authentication
@ -38,6 +37,15 @@ Uses basic auth for the rest api.
It's **higly reccomended** that you use secrets! 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.
```yml
# .github/workflows/my-workflow.yml
# ...
token: ${{ secrets.token }}
```
## Development ## Development
@ -47,3 +55,21 @@ It's **higly reccomended** that you use secrets!
4. Change `uses: confluence-markdown-sync` -> `uses: ./` 4. Change `uses: confluence-markdown-sync` -> `uses: ./`
5. Create an example markdown file `Some.md` and set it in the config `from: './Some.md'` 5. Create an example markdown file `Some.md` and set it in the config `from: './Some.md'`
6. Run locally `act -b` 6. Run locally `act -b`
### With secrets
You can simply create a `.secrets` file and specify it to `act`
```
token=abc123
```
```yml
# .github/workflows/dev.yml
# ...
token: ${{ secrets.token }}
```
```bash
act -b --secret-file .secrets
```