Skip to content

Commit d6ba80f

Browse files
authoredApr 27, 2024··
Initial commit
0 parents  commit d6ba80f

10 files changed

+525
-0
lines changed
 

‎.github/dependabot.yml

+48
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

+49
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

+28
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

+35
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

+64
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/automerge-action@v0.15.6
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

+147
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}}"

‎.github/workflows/issues-stale.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
# Manage stale issues and PRs.
7+
8+
name: Stale Issues / PRs
9+
10+
on:
11+
schedule:
12+
- cron: '00 10 * * *'
13+
14+
jobs:
15+
stale:
16+
name: Check Stale Issues / PRs
17+
if: startsWith(github.repository, 'LizardByte/')
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Stale
21+
uses: actions/stale@v9
22+
with:
23+
close-issue-message: >
24+
This issue was closed because it has been stalled for 10 days with no activity.
25+
close-pr-message: >
26+
This PR was closed because it has been stalled for 10 days with no activity.
27+
days-before-stale: 90
28+
days-before-close: 10
29+
exempt-all-assignees: true
30+
exempt-issue-labels: 'added,fixed'
31+
exempt-pr-labels: 'dependencies,l10n'
32+
stale-issue-label: 'stale'
33+
stale-issue-message: >
34+
It seems this issue hasn't had any activity in the past 90 days.
35+
If it's still something you'd like addressed, please let us know by leaving a comment.
36+
Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!
37+
stale-pr-label: 'stale'
38+
stale-pr-message: >
39+
It looks like this PR has been idle for 90 days.
40+
If it's still something you're working on or would like to pursue,
41+
please leave a comment or update your branch.
42+
Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks!
43+
repo-token: ${{ secrets.GH_BOT_TOKEN }}
44+
45+
- name: Invalid Template
46+
uses: actions/stale@v9
47+
with:
48+
close-issue-message: >
49+
This issue was closed because the the template was not completed after 5 days.
50+
close-pr-message: >
51+
This PR was closed because the the template was not completed after 5 days.
52+
days-before-stale: 0
53+
days-before-close: 5
54+
only-labels: 'invalid:template-incomplete'
55+
stale-issue-label: 'invalid:template-incomplete'
56+
stale-issue-message: >
57+
Invalid issues template.
58+
stale-pr-label: 'invalid:template-incomplete'
59+
stale-pr-message: >
60+
Invalid PR template.
61+
repo-token: ${{ secrets.GH_BOT_TOKEN }}

‎.github/workflows/issues.yml

+25
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 }}

‎.github/workflows/yaml-lint.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
# Lint yaml files.
7+
8+
name: yaml lint
9+
10+
on:
11+
pull_request:
12+
branches: [master, nightly]
13+
types: [opened, synchronize, reopened]
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
yaml-lint:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Find additional files
27+
id: find-files
28+
run: |
29+
# space separated list of files
30+
FILES=.clang-format
31+
32+
# empty placeholder
33+
FOUND=""
34+
35+
for FILE in ${FILES}; do
36+
if [ -f "$FILE" ]
37+
then
38+
FOUND="$FOUND $FILE"
39+
fi
40+
done
41+
42+
echo "found=${FOUND}" >> $GITHUB_OUTPUT
43+
44+
- name: yaml lint
45+
id: yaml-lint
46+
uses: ibiqlik/action-yamllint@v3
47+
with:
48+
# https://yamllint.readthedocs.io/en/stable/configuration.html#default-configuration
49+
config_data: |
50+
extends: default
51+
rules:
52+
comments:
53+
level: error
54+
line-length:
55+
max: 120
56+
truthy:
57+
# GitHub uses "on" for workflow event triggers
58+
# .clang-format file has options of "Yes" "No" that will be caught by this, so changed to "warning"
59+
allowed-values: ['true', 'false', 'on']
60+
check-keys: true
61+
level: warning
62+
file_or_dir: . ${{ steps.find-files.outputs.found }}
63+
64+
- name: Log
65+
run: |
66+
cat "${{ steps.yaml-lint.outputs.logfile }}" >> $GITHUB_STEP_SUMMARY

‎README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# template-base
2+
Base repository template for LizardByte.

0 commit comments

Comments
 (0)
Please sign in to comment.