Skip to content
This repository was archived by the owner on Mar 10, 2023. It is now read-only.
Open
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
79 changes: 79 additions & 0 deletions .github/workflows/codeql-scheduled.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: "CodeQL - Complete analysis"

on:
schedule:
- cron: '44 23 13 * *' # Run CodeQL scan on a day of every month at 11:44 PM UTC

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
timeout-minutes: 30 # Set timeout to 30 minutes; Change if your project takes longer to scan
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'cpp', 'ruby' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# This step will try to find a Dockerfile in the repository and extract the Ruby version from it.
# If you don't use Docker, you can remove this step and add the Ruby version directly to the
# ruby-version parameter in the `ruby/setup-ruby` step below.
- if: matrix.language == 'ruby'
name: Find Ruby version in Dockerfile
id: find-ruby-version-in-dockerfile
run: |
ruby_version=$(find . -name Dockerfile -exec sed -En 's/^FROM ruby:([0-9.]+)(.*)/\1/p' {} \;)
if [ -z "$ruby_version" ]; then
echo "No Dockerfile found, using default Ruby version"
ruby_version="2.7"
else
echo "Found Dockerfile, using Ruby version $ruby_version"
fi
echo USE_RUBY_VERSION=$ruby_version >> $GITHUB_OUTPUT

- if: matrix.language == 'ruby'
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ steps.find-ruby-version-in-dockerfile.outputs.USE_RUBY_VERSION }} # The version of Ruby to use
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
#env:
# BUNDLE_GEMFILE: ./path/to/Gemfile # Change this to the path to your Gemfile if not in root

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# queries: security-extended,security-and-quality
# debug: true # Only use this for debugging. It will increase the runtime of the action and take up storage.

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- if: matrix.language == 'cpp' || matrix.language == 'csharp' || matrix.language == 'go' || matrix.language == 'java'
name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"