Skip to content

Commit 4a0dfaa

Browse files
authored
Add CodeQL standard gha workflow (#56)
1 parent 883c3be commit 4a0dfaa

2 files changed

Lines changed: 90 additions & 2 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"features": {
55
"ghcr.io/devcontainers/features/python:1": {},
66
"ghcr.io/gvatsal60/dev-container-features/pre-commit": {},
7-
"ghcr.io/eitsupi/devcontainer-features/go-task:latest": {}
87
},
98
"postCreateCommand": "bash ./scripts/devcontainer_start.sh",
109
"customizations": {
@@ -20,7 +19,8 @@
2019
"editorconfig.editorconfig",
2120
"davidanson.vscode-markdownlint",
2221
"foxundermoon.shell-format",
23-
"gruntfuggly.todo-tree"
22+
"gruntfuggly.todo-tree",
23+
"harrydowning.yaml-embedded-languages"
2424
],
2525
"settings": {
2626
"editor.formatOnSave": true,
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
files:
2+
- .github/workflows/z-codeql.yaml:
3+
content: | # yaml
4+
# For most projects, this workflow file will not need changing; you simply need
5+
# to commit it to your repository.
6+
#
7+
# You may wish to alter this file to override the set of languages analyzed,
8+
# or to provide custom queries or build logic.
9+
#
10+
# ******** NOTE ********
11+
# We have attempted to detect the languages in your repository. Please check
12+
# the `language` matrix defined below to confirm you have the correct set of
13+
# supported CodeQL languages.
14+
#
15+
name: 'CodeQL'
16+
17+
on:
18+
push:
19+
branches: ['develop', 'master', 'release**']
20+
# paths-ignore:
21+
# - '**/__mockData__'
22+
pull_request:
23+
# The branches below must be a subset of the branches above
24+
branches: ['develop', 'release**']
25+
# paths-ignore:
26+
# - '**/__mockData__'
27+
schedule:
28+
- cron: '42 10 * * 1'
29+
30+
jobs:
31+
analyze:
32+
name: Analyze
33+
# Runner size impacts CodeQL analysis time. To learn more, please see:
34+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
35+
# - https://gh.io/supported-runners-and-hardware-resources
36+
# - https://gh.io/using-larger-runners
37+
# Consider using larger runners for possible analysis time improvements.
38+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
39+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
40+
permissions:
41+
actions: read
42+
contents: read
43+
security-events: write
44+
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
language: ['javascript']
49+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
50+
# Use only 'java' to analyze code written in Java, Kotlin or both
51+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
52+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
53+
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@{{@ "actions/checkout" | latest_release @}}
57+
58+
# Initializes the CodeQL tools for scanning.
59+
- name: Initialize CodeQL
60+
uses: github/codeql-action/init@{{@ "github/codeql-action" | latest_release @}}
61+
with:
62+
languages: ${{ matrix.language }}
63+
# If you wish to specify custom queries, you can do so here or in a config file.
64+
# By default, queries listed here will override any specified in a config file.
65+
# Prefix the list here with '+' to use these queries and those in the config file.
66+
67+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
68+
# queries: security-extended,security-and-quality
69+
70+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
71+
# If this step fails, then you should remove it and run the build manually (see below)
72+
- name: Autobuild
73+
uses: github/codeql-action/autobuild@{{@ "github/codeql-action" | latest_release @}}
74+
75+
# ℹ️ Command-line programs to run using the OS shell.
76+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
77+
78+
# If the Autobuild fails above, remove it and uncomment the following three lines.
79+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
80+
81+
# - run: |
82+
# echo 'Run, Build Application using script'
83+
# ./location_of_script_within_repo/buildscript.sh
84+
85+
- name: Perform CodeQL Analysis
86+
uses: github/codeql-action/analyze@{{@ "github/codeql-action" | latest_release @}}
87+
with:
88+
category: '/language:${{matrix.language}}'

0 commit comments

Comments
 (0)