Skip to content
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
13 changes: 11 additions & 2 deletions .github/actions/github.issue.welcome/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,17 @@ Messages are passed as data and retain their Markdown formatting.

The reusable workflow supplies default messages, falls back to `github.token` when
no token secret is provided, and serializes runs for the same issue or PR. Callers
grant the permissions needed for their events; a PR-only caller needs only
`pull-requests: write`.
grant the permissions needed for their events. A PR-only caller needs both
`issues: read` for the Issues API used to query contribution history and
`pull-requests: write` for comments. An issue-only caller needs `issues: write`.

```yaml
permissions:
issues: read
pull-requests: write
```

For a caller handling both issues and pull requests:

```yaml
name: Welcome
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/github.issue.welcome/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
github_token:
required: false
default: ${{ github.token }}
description: "(Optional) The GitHub token used to read contribution history and post comments. Requires `issues: write` for issues or `pull-requests: write` for pull requests. Defaults to the workflow's default token."
description: "(Optional) The GitHub token used to read contribution history and post comments. Requires `issues: write` for issues; for pull requests, requires both `issues: read` for history and `pull-requests: write` for comments. Defaults to the workflow's default token."

outputs:
comment_id:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github.issue.welcome.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on:
secrets:
token:
required: false
description: "(Optional) The GitHub API token to use when communicating with GitHub API. Defaults to the workflow's default token. Requires `issues: write` for issues or `pull-requests: write` for pull requests."
description: "(Optional) The GitHub API token to use when communicating with GitHub API. Defaults to the workflow's default token. Requires `issues: write` for issues; for pull requests, requires both `issues: read` for history and `pull-requests: write` for comments."


jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/github.pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
if: ${{ github.event_name == 'pull_request_target' && github.event.action == 'opened' }}

permissions:
issues: read
pull-requests: write

with:
Expand Down
Loading