Skip to content

Conversation

@willhoy
Copy link
Contributor

@willhoy willhoy commented May 10, 2024

Problem statement

This works faster than the one we have currently

willhoy and others added 4 commits May 10, 2024 18:17
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>
Comment on lines +5 to +18
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

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

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.


Suggested changeset 1
.github/workflows/formatting-check.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/formatting-check.yml b/.github/workflows/formatting-check.yml
--- a/.github/workflows/formatting-check.yml
+++ b/.github/workflows/formatting-check.yml
@@ -2,2 +2,4 @@
 on: [push, pull_request]
+permissions:
+  contents: read
 jobs:
EOF
@@ -2,2 +2,4 @@
on: [push, pull_request]
permissions:
contents: read
jobs:
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants