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
6 changes: 3 additions & 3 deletions .github/workflows/examples/auto-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: 'file' # Use .clang-format config file
tidy-checks: '-*' # disable clang-tidy
auto-fix: 'true' # auto-apply clang-format fixes
style: 'file' # Use .clang-format config file. (2)
tidy-checks: '-*' # disable clang-tidy. (3)
auto-fix: 'true' # auto-apply clang-format fixes. (1)

- name: Fail fast?!
if: steps.linter.outputs.clang-format-checks-failed > 0
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/examples/only-PR-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
cpp-linter:
runs-on: ubuntu-latest
permissions: # (1)!
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v7
Expand All @@ -25,7 +26,8 @@ jobs:
style: 'file' # Use .clang-format config file. (2)
tidy-checks: '' # Use .clang-tidy config file. (3)
# only 'update' a single comment in a pull request's thread. (4)
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }}
# Pull requests from forks get a read-only token, so skip the comment there.
thread-comments: ${{ github.event.pull_request.head.repo.full_name == github.repository && 'update' }}

- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
Expand Down
8 changes: 3 additions & 5 deletions docs/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@ The [`thread-comments`](inputs-outputs.md#thread-comments) feature requires the

```yaml
permissions:
metadata: read # (1)!
contents: write # (2)!
contents: write # (1)!
```

1. needed to fetch existing comments
2. needed to post or update a commit comment. This also allows us to delete
an outdated comment if needed.
1. needed to fetch existing comments and to post or update a commit comment.
This also allows us to delete an outdated comment if needed.

=== "`#!yaml on: pull_request`"

Expand Down
Loading