Repository navigation
Sync develop with main - #37
Conversation
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical authorization, command-injection, and check-gating issues remain unresolved; Docker lint is also non-blocking.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 4
Open (5)
Incomplete required-check validation permits unsafe merges · New Branch name spoofing bypasses Dependabot authorization · New Untrusted branch enables code execution with write token · New Workflow inputs enable shell injection with write token · New Hadolint no-fail setting allows lint failures to merge · New
What changed in this PR
Synchronizes CI/CD improvements, CodeQL, Docker linting, and Dependabot automation from develop into main.
Changes:
- Adds Docker linting and JavaScript/TypeScript CodeQL analysis.
- Adds Dependabot auto-merge automation.
- Configures Dependabot updates for
mainanddevelop. - Adds an
automergeMake target.
Findings:
- Critical: Dependabot authorization relies on attacker-controlled branch names in both the workflow and script (lines 45/66 and 228/308).
- Critical: Workflow-dispatch inputs can enable shell injection with write permissions.
- Critical: Check evaluation can merge without verifying the required workflows.
- Moderate: Docker lint findings do not fail the workflow.
| File | Description |
|---|---|
Makefile |
Adds the automerge target. |
.github/workflows/docker-lint.yml |
Runs Hadolint and uploads SARIF results. |
.github/workflows/dependabot-automerge.yml |
Automates Dependabot PR verification and merging. |
.github/workflows/codeql.yml |
Extends CodeQL analysis to JavaScript/TypeScript. |
.github/scripts/dependabot-automerge.sh |
Evaluates checks and merges eligible PRs. |
.github/dependabot.yml |
Configures dependency updates for main and develop. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| def checks: (.statusCheckRollup // []); | ||
| def total: (checks | length); | ||
| def pending: [checks[] | select(is_completed | not) | "\(check_name):\(check_state)"]; | ||
| def failed: [checks[] | select(is_completed and (is_success | not)) | "\(check_name):\(check_state)"]; | ||
|
|
||
| { | ||
| total: total, | ||
| pending_count: (pending | length), | ||
| pending_list: pending, | ||
| failed_count: (failed | length), | ||
| failed_list: failed, | ||
| ready_to_merge: (total > 0 and (pending | length) == 0 and (failed | length) == 0) |
| fi | ||
|
|
||
| # Verify Dependabot origin | ||
| if [[ "$author_login" != "app/dependabot" && "$author_login" != "dependabot[bot]" && ! "$head_ref" =~ ^dependabot/ ]]; then |
| if: >- | ||
| github.event_name == 'workflow_dispatch' || | ||
| github.event_name == 'schedule' || | ||
| (github.event_name == 'pull_request' && (github.event.pull_request.user.login == 'dependabot[bot]' || startsWith(github.event.pull_request.head.ref, 'dependabot/'))) || |
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| FLAGS="" | ||
| if [[ "${{ inputs.dry_run }}" == "true" ]]; then | ||
| FLAGS="--dry-run" | ||
| fi | ||
|
|
||
| if [[ -n "${{ inputs.pr_number }}" ]]; then | ||
| echo "Running automerge on specified PR #${{ inputs.pr_number }}..." | ||
| ./.github/scripts/dependabot-automerge.sh "${{ inputs.pr_number }}" $FLAGS |
| dockerfile: Dockerfile | ||
| format: sarif | ||
| output-file: hadolint-results.sarif | ||
| no-fail: true |


Synchronize CI/CD improvements, CodeQL configuration, Dependabot multi-branch updates, and Dependabot auto-merge automation from develop into main.