Skip to content

Commit d6ba80f

Browse files
Initial commit
0 parents  commit d6ba80f

File tree

10 files changed

+525
-0
lines changed

10 files changed

+525
-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 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+
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 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+
# 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/pr_release_template.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Description
2+
<!--- Please include a summary of the changes. --->
3+
This PR was created automatically.
4+
5+
6+
### Screenshot
7+
<!--- Include screenshots if the changes are UI-related. --->
8+
9+
10+
### Issues Fixed or Closed
11+
<!--- Close issue example: `- Closes #1` --->
12+
<!--- Fix bug issue example: `- Fixes #2` --->
13+
<!--- Resolve issue example: `- Resolves #3` --->
14+
15+
16+
## Type of Change
17+
- [ ] Bug fix (non-breaking change which fixes an issue)
18+
- [ ] New feature (non-breaking change which adds functionality)
19+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
20+
- [ ] Dependency update (updates to dependencies)
21+
- [ ] Documentation update (changes to documentation)
22+
- [ ] Repository update (changes to repository files, e.g. `.github/...`)
23+
24+
## Branch Updates
25+
- [x] I want maintainers to keep my branch updated
26+
27+
## Changelog Summary
28+
<!--- Summarize all the changes in a bulleted list. --->

.github/workflows/auto-create-pr.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 creates a PR automatically when anything is merged/pushed into the `nightly` branch. The PR is created
7+
# against the `master` (default) branch.
8+
9+
name: Auto create PR
10+
11+
on:
12+
push:
13+
branches:
14+
- 'nightly'
15+
16+
jobs:
17+
create_pr:
18+
if: startsWith(github.repository, 'LizardByte/')
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Create Pull Request
26+
uses: repo-sync/pull-request@v2
27+
with:
28+
source_branch: "" # should be "nightly" as it's the triggering branch
29+
destination_branch: "master"
30+
pr_title: "Pulling ${{ github.ref_name }} into master"
31+
pr_template: ".github/pr_release_template.md"
32+
pr_assignee: "${{ secrets.GH_BOT_NAME }}"
33+
pr_draft: true
34+
pr_allow_empty: false
35+
github_token: ${{ secrets.GH_BOT_TOKEN }}

.github/workflows/automerge.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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, first, automatically approve PRs created by @LizardByte-bot. Then it will automerge relevant PRs.
7+
8+
name: Automerge PR
9+
10+
on:
11+
pull_request:
12+
types:
13+
- opened
14+
- synchronize
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
autoapprove:
22+
if: >-
23+
contains(fromJson('["LizardByte-bot"]'), github.event.pull_request.user.login) &&
24+
contains(fromJson('["LizardByte-bot"]'), github.actor) &&
25+
startsWith(github.repository, 'LizardByte/')
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Autoapproving
29+
uses: hmarr/auto-approve-action@v3
30+
with:
31+
github-token: "${{ secrets.GITHUB_TOKEN }}"
32+
33+
- name: Label autoapproved
34+
uses: actions/github-script@v7
35+
with:
36+
github-token: ${{ secrets.GH_BOT_TOKEN }}
37+
script: |
38+
github.rest.issues.addLabels({
39+
issue_number: context.issue.number,
40+
owner: context.repo.owner,
41+
repo: context.repo.repo,
42+
labels: ['autoapproved', 'autoupdate']
43+
})
44+
45+
automerge:
46+
if: startsWith(github.repository, 'LizardByte/')
47+
needs: [autoapprove]
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- name: Automerging
52+
uses: pascalgn/[email protected]
53+
env:
54+
BASE_BRANCHES: nightly
55+
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
56+
GITHUB_LOGIN: ${{ secrets.GH_BOT_NAME }}
57+
MERGE_LABELS: "!dependencies"
58+
MERGE_METHOD: "squash"
59+
MERGE_COMMIT_MESSAGE: "{pullRequest.title} (#{pullRequest.number})"
60+
MERGE_DELETE_BRANCH: true
61+
MERGE_ERROR_FAIL: true
62+
MERGE_FILTER_AUTHOR: ${{ secrets.GH_BOT_NAME }}
63+
MERGE_RETRIES: "240" # 1 hour
64+
MERGE_RETRY_SLEEP: "15000" # 15 seconds

.github/workflows/codeql.yml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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", "nightly"]
13+
pull_request:
14+
branches: ["master", "nightly"]
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+
!matrix['include'].includes({"language": key.toLowerCase()})) {
62+
console.log(`Found supported language: ${key}`)
63+
matrix['include'].push({"language": key.toLowerCase()})
64+
}
65+
}
66+
67+
// print languages
68+
console.log(`matrix: ${JSON.stringify(matrix)}`)
69+
70+
return matrix
71+
72+
- name: Continue
73+
uses: actions/github-script@v7
74+
id: continue
75+
with:
76+
script: |
77+
// if matrix['include'] is an empty list return false, otherwise true
78+
const matrix = ${{ steps.lang.outputs.result }} // this is already json encoded
79+
80+
if (matrix['include'].length == 0) {
81+
return false
82+
} else {
83+
return true
84+
}
85+
86+
analyze:
87+
name: Analyze
88+
if: ${{ needs.languages.outputs.continue == 'true' }}
89+
needs: [languages]
90+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
91+
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
92+
permissions:
93+
actions: read
94+
contents: read
95+
security-events: write
96+
97+
strategy:
98+
fail-fast: false
99+
matrix: ${{ fromJson(needs.languages.outputs.matrix) }}
100+
101+
steps:
102+
- name: Maximize build space
103+
uses: easimon/maximize-build-space@v8
104+
with:
105+
root-reserve-mb: 20480
106+
remove-dotnet: ${{ (matrix.language == 'csharp' && 'false') || 'true' }}
107+
remove-android: 'true'
108+
remove-haskell: 'true'
109+
remove-codeql: 'false'
110+
remove-docker-images: 'true'
111+
112+
- name: Checkout repository
113+
uses: actions/checkout@v4
114+
with:
115+
submodules: recursive
116+
117+
# Initializes the CodeQL tools for scanning.
118+
- name: Initialize CodeQL
119+
uses: github/codeql-action/init@v3
120+
with:
121+
languages: ${{ matrix.language }}
122+
# If you wish to specify custom queries, you can do so here or in a config file.
123+
# By default, queries listed here will override any specified in a config file.
124+
# Prefix the list here with "+" to use these queries and those in the config file.
125+
126+
# yamllint disable-line rule:line-length
127+
# 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
128+
# queries: security-extended,security-and-quality
129+
130+
# Pre autobuild
131+
# create a file named .codeql-prebuild-${{ matrix.language }}.sh in the root of your repository
132+
- name: Prebuild
133+
run: |
134+
# check if .qodeql-prebuild-${{ matrix.language }}.sh exists
135+
if [ -f "./.codeql-prebuild-${{ matrix.language }}.sh" ]; then
136+
echo "Running .codeql-prebuild-${{ matrix.language }}.sh"
137+
./.codeql-prebuild-${{ matrix.language }}.sh
138+
fi
139+
140+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
141+
- name: Autobuild
142+
uses: github/codeql-action/autobuild@v3
143+
144+
- name: Perform CodeQL Analysis
145+
uses: github/codeql-action/analyze@v3
146+
with:
147+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)