Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Code scanning

How to add security scanning to a GitHub Actions workflow

By Freedom251 Team · · 10 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The safest low-maintenance starting point is GitHub CodeQL default setup: open the repository’s security settings, enable code scanning, and let GitHub select supported languages, query suites and scan events. Choose advanced setup when you need to edit triggers, queries, build commands or permissions yourself. Add pull-request dependency review for package changes, schedule periodic scans, and keep workflow tokens and secrets least-privileged.

This guide shows how to choose the right checks, enable them, customize the generated workflow, scan GitHub Actions YAML, and avoid the permission and secret-handling mistakes that can turn a security workflow into a new attack path.

As an Amazon Associate I earn from qualifying purchases.

What security scanning in GitHub Actions should cover

A useful pipeline separates several jobs rather than treating “security scanning” as one check:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Code scanning: analyzes source code for vulnerabilities and coding patterns. CodeQL is GitHub’s native option.
  • Workflow scanning: CodeQL includes built-in queries for GitHub Actions workflow files, so YAML under .github/workflows/ can be analyzed too. See GitHub’s Actions query reference.
  • Dependency review: examines dependency changes in a pull request and can warn when a proposed package introduces known vulnerability information. It complements, rather than replaces, code scanning; details are in GitHub’s dependency review documentation.
  • Workflow hardening: limits the GITHUB_TOKEN, protects secrets, and prevents untrusted pull-request code from receiving privileges it does not need.

Run checks on pushes and pull requests so changes are assessed as they are made. A scheduled run is also valuable because a repository can become vulnerable after a new weakness is published even when nobody has committed code recently.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

Choose default setup, advanced setup or another scanner

Choice Best fit What to verify
CodeQL default setup You want the fastest supported route with little workflow maintenance. GitHub chooses languages, query suites and scan-triggering events. Confirm that the repository is eligible and that automatic language and build detection fit the project.
CodeQL advanced setup You need control over events, query packs, build behavior, runners or permissions. You must maintain the workflow. Compiled languages may need deliberate build configuration.
Another scanner Your organization already standardizes on a different analysis engine or the language coverage better matches that tool. Check its GitHub integration, required permissions, result format, runner support and availability before adding it.
Dependency review You want a focused gate for packages added, removed or updated in pull requests. It analyzes dependency changes; it is not a substitute for source and workflow analysis.

The practical decision is a balance of configuration effort and control, repository and plan eligibility, language and build coverage, when checks run, and whether you are analyzing source/workflow code or dependency changes.

Check repository eligibility before changing settings

Code scanning and other GitHub Advanced Security features are not available under identical conditions for every repository. GitHub documents availability for public repositories and for certain organization-owned repositories on paid plans with GitHub Code Security enabled. Product names and eligibility rules can change, so check the current GitHub Advanced Security eligibility documentation and the repository security quickstart before giving your team a rollout procedure.

You also need permission to change repository security settings and workflows. If the feature or menu is absent, the cause may be repository visibility, organization policy, plan entitlement or insufficient administrative permission rather than a broken workflow.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enable CodeQL with default setup

Default setup is the right first attempt when GitHub’s automatic choices match your project.

  1. Open the repository on GitHub and select Settings.
  2. Open the repository’s Code security and analysis area. GitHub may adjust menu wording as its security settings evolve.
  3. Find code scanning and choose Set up or Enable for CodeQL default setup.
  4. Review the languages and configuration GitHub detects. Confirm that the important production languages are included and that generated or vendored directories will not dominate the analysis.
  5. Review the proposed query suite and events, then save the configuration.
  6. Open the repository’s Actions tab and verify that the first analysis run starts and completes. Findings appear in the repository’s code-scanning results when analysis finishes.

GitHub determines the repository languages, query suites and scan-triggering events in default setup. That automation is convenient, but it also means you should inspect the resulting coverage instead of assuming every language or build step was detected correctly.

Use advanced setup when the generated workflow is not enough

Advanced setup creates a workflow file that you can edit. Use it when you need a specific branch policy, a scheduled frequency, custom queries, a controlled build or a deliberately constrained runner. GitHub’s workflow configuration reference documents the supported options and current action guidance.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Start from GitHub’s generated workflow

  1. In the same code-scanning settings area, choose the advanced setup option rather than default setup.
  2. Select the languages that require analysis and review the generated workflow before committing it.
  3. Keep the workflow in .github/workflows/ and commit it to the default branch or the branch from which your pull requests are opened.
  4. Inspect the generated on, permissions, build and analysis sections. Remove triggers and permissions that your project does not need.
  5. Commit the file, open a test pull request, and inspect the complete run and the resulting code-scanning alerts.

Current GitHub examples use the github/codeql-action action family and commonly show @v4. Action releases and recommended syntax are volatile; use the version shown in the current official configuration documentation rather than copying an old snippet indefinitely.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Account for compiled-language builds

For compiled languages, CodeQL may need a real build or an explicit build mode. A workflow that only checks out source and skips the project’s build can produce incomplete results. Verify the generated build configuration, required package installation and compiler availability on the selected runner. If the project uses an unusual build system, make the build steps explicit in advanced setup and test them on a pull request before relying on the check as a merge gate.

Customize queries carefully

Use the default query suite unless you have a reason to change it. Add a broader or organization-specific suite when you understand the additional findings and triage cost. Query customization should be reviewed like application code: document why it exists, test it against representative code and remove obsolete overrides so the workflow remains understandable.

Configure events so scans happen at the right time

Push scans

A push event scans committed changes after they land on a configured branch. It is useful for protection of the default branch and for catching changes made outside a pull request.

Pull-request scans

Pull-request events provide feedback while a change is still proposed. They are the natural place to make code scanning and dependency review required checks, subject to your team’s policy and the time needed for the analysis.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Scheduled scans

A scheduled run checks the repository even when it has been inactive. This matters when a vulnerability is newly discovered in code or a dependency after the last commit. Choose a cadence that fits runner capacity and triage staffing; a schedule is useful only if someone reviews and acts on its findings.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

For advanced workflows, configure push, pull-request and schedule events explicitly and confirm that branch filters do not accidentally exclude the branches where changes are developed. GitHub explains the available trigger and schedule settings in its workflow configuration options.

Add dependency review to pull requests

Dependency review is a focused pull-request check. It compares the dependency changes in the proposed merge and can warn about vulnerabilities associated with newly introduced, removed or updated components. This catches supply-chain risk before the change enters the project, while CodeQL examines code and workflow behavior.

  1. Open GitHub’s dependency review action guide and use its current workflow example.
  2. Place the workflow under .github/workflows/ and trigger it for pull requests that can modify dependency manifests or lock files.
  3. Review the action’s current version and supported configuration in the official guide; do not freeze an obsolete tag copied from an older article.
  4. Run it against a test pull request that changes a package version, then confirm that the check reports the change in the pull request interface.
  5. Decide which severity or license conditions should block merging. Start with an enforceable policy and document an exception process for false positives or urgent upgrades.

Dependency review does not inspect all application behavior, and CodeQL does not replace it. Keeping the checks separate makes it clear whether a failure concerns source code, workflow configuration or a package change.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Scan GitHub Actions workflow files themselves

Workflow YAML can expose tokens, invoke untrusted code or grant excessive permissions. CodeQL has built-in queries specifically for GitHub Actions workflows, including patterns that can indicate unsafe workflow construction. The applicable queries and repository conditions are listed in GitHub’s Actions built-in query reference.

To make this useful, ensure the directory containing your workflows is included in the checked-out source and that the language and query configuration actually enables the Actions queries. After the first run, open code-scanning results and filter for alerts associated with workflow files. Treat a workflow finding as a pipeline-security issue, not merely a formatting problem: inspect who can trigger the workflow, what code it checks out, which token permissions it receives and whether secrets are available at that point.

Set least-privilege permissions

Start with restrictive workflow and job permissions, then add only the access a step demonstrably requires. GitHub’s secure-use reference says it is good security practice to set the default GITHUB_TOKEN permission for repository contents to read access only. Read the full guidance at GitHub’s Secure use reference.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

A practical pattern is to declare a read-only default and grant a narrowly scoped write permission only on the specific job that needs it. Recheck permissions after adding an action, because an action may fail with too little access, while granting broad write access can let compromised code alter the repository, releases or pull requests.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Keep contents read-only unless a job must write repository content.
  • Give pull-request write access only when a trusted job must comment, label or update a pull request.
  • Separate analysis from publishing or deployment jobs so a scanner does not inherit deployment credentials.
  • Review permissions at both workflow and job level; the more specific job setting should reflect the actual operation.
  • Pin third-party actions to verified commits where your governance requires it, rather than trusting a mutable tag. GitHub discusses action pinning and other controls in the secure-use guidance.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Protect secrets and untrusted pull-request code

GitHub encrypts secrets before they reach GitHub, and a workflow can read a secret only when you explicitly pass it to a step. GitHub recommends generating credentials with the minimum permissions required; see the Secrets documentation.

Do not expose sensitive credentials to code from an untrusted pull request. A contributor-controlled branch can change scripts that run in the workflow, so a scan job that checks out and executes that code must not also receive production keys or a token with write access. Keep privileged operations in a separate, trusted job and require an approval boundary where appropriate.

Never treat log masking as a guarantee that a transformed secret is safe. GitHub states that, because a secret can be transformed in multiple ways, redaction is not guaranteed. Avoid printing secrets, derived values or entire environments; pass only the values a step needs and inspect third-party actions before allowing them to process credentials.

Validate and tune the first runs

  1. Confirm the trigger: make a small branch change and open a pull request, then verify that the expected workflow starts.
  2. Read setup and build logs: distinguish a genuine finding from a checkout, dependency-installation, compiler or runner failure.
  3. Check language coverage: compare detected languages with the repository’s actual production code, including less common extensions and generated-code boundaries.
  4. Review alerts in context: determine whether the data flow is reachable and whether the finding is a true defect before suppressing it.
  5. Record justified exclusions: document why a path or query is excluded and set a review date so exclusions do not become permanent blind spots.
  6. Measure operational cost: if pull-request analysis is too slow, optimize checkout and build work or adjust event scope rather than silently removing the security check.

Troubleshoot common failures

The setup option is missing

Recheck repository visibility, organization ownership, plan eligibility, GitHub Code Security availability and your administrative permission. The applicable conditions are described in GitHub Advanced Security documentation; they can change over time.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The workflow runs but finds no languages

Inspect checkout paths, file extensions and generated-code exclusions. In advanced setup, verify that the selected language configuration matches the repository and that the analysis step runs after checkout.

A compiled project fails during analysis

Read the build log first. Install the project’s dependencies and toolchain on the runner, then configure the build mode or explicit build commands required by the language. A successful YAML parse does not prove that the compiler and project build are available.

Pull requests from forks cannot access a secret

This is an intentional safety boundary in many repository configurations. Do not work around it by exposing a valuable secret to untrusted code. Separate the untrusted analysis from any trusted, approval-gated operation and redesign the job so the scanner does not require credentials.

Alerts are overwhelming

Prioritize reachable, exploitable paths and findings on changed code, then improve query or path configuration based on evidence. Do not disable the entire scanner because a single rule is noisy; narrow or document the exception and continue receiving the remaining results.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The scan is unexpectedly slow

Look for repeated dependency installation, unnecessary full builds and oversized checkout paths. Keep pull-request checks focused on timely feedback, while using scheduled runs for broader coverage when that better fits runner capacity.

Use this maintenance checklist

  • Review CodeQL and dependency-review action versions against the current GitHub documentation.
  • Recheck repository and plan eligibility when ownership, visibility or billing changes.
  • Confirm that push, pull-request and scheduled events still match the way the team develops and releases.
  • Audit workflow and job permissions after every substantial workflow edit.
  • Rotate credentials and remove secrets that no longer have a purpose.
  • Review workflow-file alerts as seriously as application-code alerts.
  • Inspect scheduled-run results even when no code was recently merged.
  • Keep documented suppressions, exclusions and dependency-review exceptions under regular review.

For the authoritative, changing details—available features, current action versions, configuration keys and repository eligibility—use GitHub’s security quickstart, workflow configuration reference and secure-use reference when you implement or revise the workflow.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Code scanningCodeQLdependency reviewDevSecOpsGitHub Actionsworkflow security

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.