Skip to content
Merged
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
15 changes: 15 additions & 0 deletions .github/workflows/compliance-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: compliance

on:
push:
branches: [main]
pull_request:

jobs:
compliance:
uses: CHITTYOS/chittyops/.github/workflows/reusable-compliance-check.yml@main
with:
service_name: 'chittycommand'
tier: 3
check_health: true
domain: 'command.chitty.cc'
Comment on lines +10 to +15

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: {}

Copilot Autofix

AI 3 days ago

In general, to fix this category of issue you add a permissions: block either at the top (root) of the workflow to apply to all jobs, or under a specific job to apply only there. The block should grant the minimum scopes needed. For workflows that only run checks and do not need to write back to the repository, contents: read is a good baseline. If the reusable workflow needs additional permissions (for example, to update issues or pull requests), those can be added explicitly.

For this specific workflow, the simplest and safest change without altering behavior of the reusable workflow is to declare minimal read-only permissions at the workflow root, just under the name: key and before on:. This ensures the GITHUB_TOKEN available to the compliance job (and thus to the called reusable workflow) is constrained to read repository contents by default. If the reusable workflow requires more permissions, they can still be granted there; our change does not prevent that, but documents and constrains the default from this workflow’s side. Concretely, in .github/workflows/compliance-check.yml, add:

permissions:
  contents: read

between lines 1 and 3. No imports or additional methods are needed, since this is a YAML configuration change only.

Suggested changeset 1
.github/workflows/compliance-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/compliance-check.yml b/.github/workflows/compliance-check.yml
--- a/.github/workflows/compliance-check.yml
+++ b/.github/workflows/compliance-check.yml
@@ -1,4 +1,6 @@
 name: compliance
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: compliance
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
Loading