Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add note about GitHub token permissions #38

Merged
merged 2 commits into from
Dec 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions comment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,19 @@ The action supports the following inputs:

- `target-type`: Optional. Which objects should be commented on, either `pull-request` or `commit`.

- `tag`: Optional. Customize the comment tag. This is added to the comment as a markdown comment to detect the previously posted comments. This is useful if you have multiple workflows that post comments to the same pull request or commit.

- `github-token`: Optional, default to `${{ github.token }}`. This is the default GitHub token available to actions and is used to post comments.
- `tag`: Optional. Customize the comment tag. This is added to the comment as a markdown comment (hidden) to detect the previously posted comments. This is useful if you have multiple workflows that post comments to the same pull request or commit.

- `github-token`: Optional, default to `${{ github.token }}`. This is the default GitHub token available to actions and is used to post comments. The default [token permissions](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#permissions) work fine; `pull-requests: write` is required if you need to customize these.

```yml
steps:
- name: Infracost comment
uses: infracost/actions/comment@v1
with:
...
permissions:
pull-requests: write
```

## Outputs

Expand Down
4 changes: 2 additions & 2 deletions comment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ inputs:
description: Which objects should be commented on, either `pull-request` or `commit`.
required: false
tag:
description: 'Customize the comment tag. This is added to the comment as a markdown comment to detect the previously posted comments. This is useful if you have multiple workflows that post comments to the same pull request or commit.'
description: 'Customize the comment tag. This is added to the comment as a markdown comment (hidden) to detect the previously posted comments. This is useful if you have multiple workflows that post comments to the same pull request or commit.'
required: false
github-token:
description: 'Default to {{ github.token }}. This is the default GitHub token available to actions and is used to post comments.'
description: 'Default to {{ github.token }}. This is the default GitHub token available to actions and is used to post comments. The default token permissions (https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#permissions) work fine; `pull-requests: write` is required if you need to customize these.'
default: '${{ github.token }}'
required: false
outputs:
Expand Down
16 changes: 13 additions & 3 deletions get-comment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,19 @@ The action supports the following inputs:

- `target-type`: Optional. The target-type set when the comment was posted (if any), either `pull_request` or `commit`.

- `tag`: Optional. Customize the comment tag. This is added to the comment as a markdown comment to detect the previously posted comments. This is useful if you have multiple workflows that post comments to the same pull request or commit.

- `github-token`: Optional, default to `${{ github.token }}`. This is the default GitHub token available to actions and is used to get comments.
- `tag`: Optional. Customize the comment tag. This is added to the comment as a markdown comment (hidden) to detect the previously posted comments. This is useful if you have multiple workflows that post comments to the same pull request or commit.

- `github-token`: Optional, default to `${{ github.token }}`. This is the default GitHub token available to actions and is used to get comments. The default [token permissions](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#permissions) work fine; `pull-requests: read` is required if you need to customize these.

```yml
steps:
- name: Infracost get comment
uses: infracost/actions/get-comment@v1
with:
...
permissions:
pull-requests: read
```

## Outputs

Expand Down
4 changes: 2 additions & 2 deletions get-comment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ inputs:
description: The target-type set when the comment was posted (if any), either `pull-request` or `commit`.
required: false
tag:
description: 'Customize the comment tag. This is added to the comment as a markdown comment to detect the previously posted comments. This is useful if you have multiple workflows that post comments to the same pull request or commit.'
description: 'Customize the comment tag. This is added to the comment as a markdown comment (hidden) to detect the previously posted comments. This is useful if you have multiple workflows that post comments to the same pull request or commit.'
required: false
github-token:
description: 'Default to {{ github.token }}. This is the default GitHub token available to actions and is used to get comments.'
description: 'Default to {{ github.token }}. This is the default GitHub token available to actions and is used to get comments. The default token permissions (https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#permissions) work fine; `pull-requests: read` is required if you need to customize these.'
default: '${{ github.token }}'
required: false
outputs:
Expand Down