Fix dependabot approval error and add deployment guards for non-app changes#34
Conversation
Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com>
Co-authored-by: PhantomDave <34485699+PhantomDave@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the dependabot auto-merge workflow failure caused by GitHub Actions' inability to approve PRs using the default GITHUB_TOKEN, and adds deployment guards to prevent unnecessary production deployments for non-application changes like workflow or documentation updates. Additionally, it introduces CodeQL security scanning for both C# backend and TypeScript frontend code.
- Removed the failing PR approval step from dependabot workflow, relying on auto-merge without explicit approval
- Added
has_app_changesoutput filter to skip production deployments when only.github/, docs, or config files change - Added comprehensive CodeQL security analysis with daily scheduled scans and exclusion of generated/build artifacts
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/dependabot-auto-merge.yml |
Removed the failing gh pr review --approve step that caused errors with GitHub Actions token permissions; updated workflow and job names to reflect auto-merge-only behavior |
.github/workflows/deploy-tailscale.yml |
Added has_app_changes output gate that evaluates backend, frontend, and compose file changes to prevent unnecessary deployments; added compose file paths to change detection filters |
.github/workflows/codeql-analysis.yml |
New workflow for security scanning with matrix strategy for C# and JavaScript/TypeScript; runs on push to main, PRs, daily at 2 AM UTC, and manual dispatch |
.github/codeql/codeql-config.yml |
New configuration excluding build artifacts, node_modules, migrations, and generated files from analysis; includes both security-extended and security-and-quality query suites |
| @@ -0,0 +1,32 @@ | |||
| name: "BankTracker CodeQL Config" | |||
|
|
|||
| # Disable default queries and use security-extended query suite for comprehensive security scanning | |||
There was a problem hiding this comment.
The comment states "Disable default queries" but the configuration sets disable-default-queries: false, which actually keeps the default queries enabled. This is contradictory. Either update the comment to say "Keep default queries enabled and add additional query suites" or set the value to true if you want to run only the specified query suites.
| # Disable default queries and use security-extended query suite for comprehensive security scanning | |
| # Keep default queries enabled and add additional query suites for comprehensive security scanning |
| - uses: security-extended | ||
| - uses: security-and-quality | ||
|
|
There was a problem hiding this comment.
Using both security-extended and security-and-quality query suites together is redundant. The security-and-quality suite already includes all security queries plus quality/maintainability checks. Consider using only security-and-quality if you want comprehensive coverage, or only security-extended if you want to focus on security with additional security-specific queries beyond the default set.
| - uses: security-extended | |
| - uses: security-and-quality | |
| - uses: security-and-quality |
The dependabot workflow was failing because GitHub Actions cannot approve PRs using the default
GITHUB_TOKEN. Additionally, production deployments were triggering for non-app changes like workflow updates.Changes
dependabot-auto-merge.yml: Removed
gh pr review --approvestep. Auto-merge works without explicit approval when repository settings permit it.deploy-tailscale.yml: Added
has_app_changesgate to skip deployment when only.github/, docs, or config files change:codeql-analysis.yml (new): Security scanning for C# backend and TypeScript frontend using
security-extendedandsecurity-and-qualitysuites. Runs on push to main, PRs, and daily at 2 AM UTC.codeql-config.yml (new): Excludes build artifacts, node_modules, migrations, and generated files from analysis.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.