Skip to content

Commit 20372c1

Browse files
Initial commit
0 parents  commit 20372c1

File tree

6 files changed

+404
-0
lines changed

6 files changed

+404
-0
lines changed

.github/dependabot.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
# This file is centrally managed in https://github.com/<organization>/.github/
3+
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4+
# the above-mentioned repo.
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "docker"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
time: "08:00"
13+
open-pull-requests-limit: 10
14+
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
schedule:
18+
interval: "daily"
19+
time: "08:30"
20+
open-pull-requests-limit: 10
21+
22+
- package-ecosystem: "npm"
23+
directory: "/"
24+
schedule:
25+
interval: "daily"
26+
time: "09:00"
27+
open-pull-requests-limit: 10
28+
29+
- package-ecosystem: "nuget"
30+
directory: "/"
31+
schedule:
32+
interval: "daily"
33+
time: "09:30"
34+
open-pull-requests-limit: 10
35+
36+
- package-ecosystem: "pip"
37+
directory: "/"
38+
schedule:
39+
interval: "daily"
40+
time: "10:00"
41+
open-pull-requests-limit: 10
42+
43+
- package-ecosystem: "gitsubmodule"
44+
directory: "/"
45+
schedule:
46+
interval: "daily"
47+
time: "10:30"
48+
open-pull-requests-limit: 10

.github/label-actions.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
# This file is centrally managed in https://github.com/<organization>/.github/
3+
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4+
# the above-mentioned repo.
5+
6+
# Configuration for Label Actions - https://github.com/dessant/label-actions
7+
8+
added:
9+
comment: >
10+
This feature has been added and will be available in the next release.
11+
fixed:
12+
comment: >
13+
This issue has been fixed and will be available in the next release.
14+
invalid:duplicate:
15+
comment: >
16+
:wave: @{issue-author}, this appears to be a duplicate of a pre-existing issue.
17+
close: true
18+
lock: true
19+
unlabel: 'status:awaiting-triage'
20+
21+
-invalid:duplicate:
22+
reopen: true
23+
unlock: true
24+
25+
invalid:support:
26+
comment: >
27+
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports.
28+
However, this issue appears to be a support request. Please use our
29+
[Support Center](https://app.lizardbyte.dev/support) for support issues. Thanks.
30+
close: true
31+
lock: true
32+
lock-reason: 'off-topic'
33+
unlabel: 'status:awaiting-triage'
34+
35+
-invalid:support:
36+
reopen: true
37+
unlock: true
38+
39+
invalid:template-incomplete:
40+
issues:
41+
comment: >
42+
:wave: @{issue-author}, please edit your issue to complete the template with
43+
all the required info. Your issue will be automatically closed in 5 days if
44+
the template is not completed. Thanks.
45+
prs:
46+
comment: >
47+
:wave: @{issue-author}, please edit your PR to complete the template with
48+
all the required info. Your PR will be automatically closed in 5 days if
49+
the template is not completed. Thanks.

.github/workflows/codeql.yml

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
---
2+
# This action is centrally managed in https://github.com/<organization>/.github/
3+
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4+
# the above-mentioned repo.
5+
6+
# This workflow will analyze all supported languages in the repository using CodeQL Analysis.
7+
8+
name: "CodeQL"
9+
10+
on:
11+
push:
12+
branches: ["master"]
13+
pull_request:
14+
branches: ["master"]
15+
schedule:
16+
- cron: '00 12 * * 0' # every Sunday at 12:00 UTC
17+
18+
concurrency:
19+
group: "${{ github.workflow }}-${{ github.ref }}"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
languages:
24+
name: Get language matrix
25+
runs-on: ubuntu-latest
26+
outputs:
27+
matrix: ${{ steps.lang.outputs.result }}
28+
continue: ${{ steps.continue.outputs.result }}
29+
steps:
30+
- name: Get repo languages
31+
uses: actions/github-script@v7
32+
id: lang
33+
with:
34+
script: |
35+
// CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift']
36+
// Use only 'java' to analyze code written in Java, Kotlin or both
37+
// Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
38+
// Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
39+
const supported_languages = ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift']
40+
41+
const remap_languages = {
42+
'c++': 'cpp',
43+
'c#': 'csharp',
44+
'kotlin': 'java',
45+
'typescript': 'javascript',
46+
}
47+
48+
const repo = context.repo
49+
const response = await github.rest.repos.listLanguages(repo)
50+
let matrix = {
51+
"include": []
52+
}
53+
54+
for (let [key, value] of Object.entries(response.data)) {
55+
// remap language
56+
if (remap_languages[key.toLowerCase()]) {
57+
console.log(`Remapping language: ${key} to ${remap_languages[key.toLowerCase()]}`)
58+
key = remap_languages[key.toLowerCase()]
59+
}
60+
if (supported_languages.includes(key.toLowerCase())) {
61+
console.log(`Found supported language: ${key}`)
62+
let osList = ['ubuntu-latest'];
63+
if (key.toLowerCase() === 'swift') {
64+
osList = ['macos-latest'];
65+
} else if (key.toLowerCase() === 'cpp') {
66+
// TODO: update macos to latest after the below issue is resolved
67+
// https://github.com/github/codeql-action/issues/2266
68+
osList = ['macos-13', 'ubuntu-latest', 'windows-latest'];
69+
}
70+
for (let os of osList) {
71+
// set name for matrix
72+
if (osList.length == 1) {
73+
name = key.toLowerCase()
74+
} else {
75+
name = `${key.toLowerCase()}, ${os}`
76+
}
77+
78+
// add to matrix
79+
matrix['include'].push({"language": key.toLowerCase(), "os": os, "name": name})
80+
}
81+
}
82+
}
83+
84+
// print languages
85+
console.log(`matrix: ${JSON.stringify(matrix)}`)
86+
87+
return matrix
88+
89+
- name: Continue
90+
uses: actions/github-script@v7
91+
id: continue
92+
with:
93+
script: |
94+
// if matrix['include'] is an empty list return false, otherwise true
95+
const matrix = ${{ steps.lang.outputs.result }} // this is already json encoded
96+
97+
if (matrix['include'].length == 0) {
98+
return false
99+
} else {
100+
return true
101+
}
102+
103+
analyze:
104+
name: Analyze (${{ matrix.name }})
105+
if: ${{ needs.languages.outputs.continue == 'true' }}
106+
defaults:
107+
run:
108+
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
109+
env:
110+
GITHUB_CODEQL_BUILD: true
111+
needs: [languages]
112+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
113+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
114+
permissions:
115+
actions: read
116+
contents: read
117+
security-events: write
118+
119+
strategy:
120+
fail-fast: false
121+
matrix: ${{ fromJson(needs.languages.outputs.matrix) }}
122+
123+
steps:
124+
- name: Maximize build space
125+
if: >-
126+
runner.os == 'Linux' &&
127+
matrix.language == 'cpp'
128+
uses: easimon/maximize-build-space@v10
129+
with:
130+
root-reserve-mb: 30720
131+
remove-dotnet: ${{ (matrix.language == 'csharp' && 'false') || 'true' }}
132+
remove-android: 'true'
133+
remove-haskell: 'true'
134+
remove-codeql: 'false'
135+
remove-docker-images: 'true'
136+
137+
- name: Checkout repository
138+
uses: actions/checkout@v4
139+
with:
140+
submodules: recursive
141+
142+
- name: Setup msys2
143+
if: >-
144+
runner.os == 'Windows' &&
145+
matrix.language == 'cpp'
146+
uses: msys2/setup-msys2@v2
147+
with:
148+
msystem: ucrt64
149+
update: true
150+
151+
# Initializes the CodeQL tools for scanning.
152+
- name: Initialize CodeQL
153+
uses: github/codeql-action/init@v3
154+
with:
155+
languages: ${{ matrix.language }}
156+
# If you wish to specify custom queries, you can do so here or in a config file.
157+
# By default, queries listed here will override any specified in a config file.
158+
# Prefix the list here with "+" to use these queries and those in the config file.
159+
160+
# yamllint disable-line rule:line-length
161+
# 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
162+
# queries: security-extended,security-and-quality
163+
config: |
164+
paths-ignore:
165+
- build
166+
- node_modules
167+
- third-party
168+
169+
# Pre autobuild
170+
# create a file named .codeql-prebuild-${{ matrix.language }}.sh in the root of your repository
171+
# create a file named .codeql-build-${{ matrix.language }}.sh in the root of your repository
172+
- name: Prebuild
173+
id: prebuild
174+
run: |
175+
# check if prebuild script exists
176+
filename=".codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh"
177+
if [ -f "./${filename}" ]; then
178+
echo "Running prebuild script: ${filename}"
179+
./${filename}
180+
fi
181+
182+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
183+
- name: Autobuild
184+
if: steps.prebuild.outputs.skip_autobuild != 'true'
185+
uses: github/codeql-action/autobuild@v3
186+
187+
- name: Perform CodeQL Analysis
188+
uses: github/codeql-action/analyze@v3
189+
with:
190+
category: "/language:${{matrix.language}}"
191+
output: sarif-results
192+
upload: failure-only
193+
194+
- name: filter-sarif
195+
uses: advanced-security/filter-sarif@v1
196+
with:
197+
input: sarif-results/${{ matrix.language }}.sarif
198+
output: sarif-results/${{ matrix.language }}.sarif
199+
patterns: |
200+
-build/**
201+
-node_modules/**
202+
-third\-party/**
203+
204+
- name: Upload SARIF
205+
uses: github/codeql-action/upload-sarif@v3
206+
with:
207+
sarif_file: sarif-results/${{ matrix.language }}.sarif
208+
209+
- name: Upload loc as a Build Artifact
210+
uses: actions/upload-artifact@v4
211+
with:
212+
name: sarif-results-${{ matrix.language }}-${{ runner.os }}
213+
path: sarif-results
214+
retention-days: 1

.github/workflows/issues.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# This action is centrally managed in https://github.com/<organization>/.github/
3+
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4+
# the above-mentioned repo.
5+
6+
# Label and un-label actions using `../label-actions.yml`.
7+
8+
name: Issues
9+
10+
on:
11+
issues:
12+
types: [labeled, unlabeled]
13+
discussion:
14+
types: [labeled, unlabeled]
15+
16+
jobs:
17+
label:
18+
name: Label Actions
19+
if: startsWith(github.repository, 'LizardByte/')
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Label Actions
23+
uses: dessant/label-actions@v4
24+
with:
25+
github-token: ${{ secrets.GH_BOT_TOKEN }}

0 commit comments

Comments
 (0)