-
Notifications
You must be signed in to change notification settings - Fork 26
Create formatting-check.yml #41
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Will <2185386+willhoy@users.noreply.github.com>
Signed-off-by: Will <2185386+willhoy@users.noreply.github.com>
Signed-off-by: Will <2185386+willhoy@users.noreply.github.com>
Signed-off-by: Will <2185386+willhoy@users.noreply.github.com>
| name: Formatting Check | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| path: | ||
| - 'src' | ||
| - 'examples' | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Run clang-format style check for C/C++/Protobuf programs. | ||
| uses: jidicula/clang-format-action@v4.15.0 | ||
| with: | ||
| clang-format-version: '14' | ||
| check-path: ${{ matrix.path }} |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 months ago
To fix the issue, add a permissions block to the workflow file. Since the workflow only performs a formatting check and does not require write access, the permissions can be limited to contents: read. This ensures that the GITHUB_TOKEN adheres to the principle of least privilege.
The permissions block should be added at the root level of the workflow file, as this will apply to all jobs in the workflow unless overridden by job-specific permissions.
-
Copy modified lines R3-R4
| @@ -2,2 +2,4 @@ | ||
| on: [push, pull_request] | ||
| permissions: | ||
| contents: read | ||
| jobs: |
Problem statement
This works faster than the one we have currently