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
8 changes: 7 additions & 1 deletion .github/workflows/compliance-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
pull_request:

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

compliance:
runs-on: ubuntu-latest
needs: [check]
steps:
- run: echo "Compliance gate passed"
Comment on lines +18 to +21

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 2 days ago

To fix the problem, explicitly declare a permissions: block that applies least-privilege settings to the workflow. Since neither job in this snippet needs to write to the repository and the compliance job appears to not use the token at all, we can set permissions: contents: read at the workflow root as a minimal, safe default. This documents the intended permissions and prevents escalation if repo/org defaults are broader. If the reusable workflow reusable-compliance-check.yml needs more granular permissions, they should be declared there; here we only constrain this workflow.

The best single change with no functional impact is to add a root-level permissions: block after the name: (or after on:) in .github/workflows/compliance-check.yml, setting contents: read. This applies to all jobs that do not override permissions, including both check and compliance. No imports or additional methods are needed; this is purely a YAML configuration change inside the workflow file.

Concretely, in .github/workflows/compliance-check.yml, insert:

permissions:
  contents: read

after line 2 (or any valid root position before jobs:). No other changes are required.

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
@@ -5,6 +5,9 @@
     branches: [main]
   pull_request:
 
+permissions:
+  contents: read
+
 jobs:
   check:
     uses: CHITTYOS/chittyops/.github/workflows/reusable-compliance-check.yml@main
EOF
@@ -5,6 +5,9 @@
branches: [main]
pull_request:

permissions:
contents: read

jobs:
check:
uses: CHITTYOS/chittyops/.github/workflows/reusable-compliance-check.yml@main
Copilot is powered by AI and may make mistakes. Always verify output.
Loading