generated from LizardByte/template-base
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 26abd9c
Showing
7 changed files
with
463 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
# This action is centrally managed in https://github.com/<organization>/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | ||
# the above-mentioned repo. | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "08:00" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "08:30" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "09:00" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "nuget" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "09:30" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "pip" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "10:00" | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: "gitsubmodule" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "10:30" | ||
open-pull-requests-limit: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
# This action is centrally managed in https://github.com/<organization>/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | ||
# the above-mentioned repo. | ||
|
||
# Configuration for Label Actions - https://github.com/dessant/label-actions | ||
|
||
added: | ||
comment: > | ||
This feature has been added and will be available in the next release. | ||
fixed: | ||
comment: > | ||
This issue has been fixed and will be available in the next release. | ||
invalid:duplicate: | ||
comment: > | ||
:wave: @{issue-author}, this appears to be a duplicate of a pre-existing issue. | ||
close: true | ||
lock: true | ||
unlabel: 'status:awaiting-triage' | ||
|
||
-invalid:duplicate: | ||
reopen: true | ||
unlock: true | ||
|
||
invalid:support: | ||
comment: > | ||
:wave: @{issue-author}, we use the issue tracker exclusively for bug reports. | ||
However, this issue appears to be a support request. Please use our | ||
[Support Center](https://app.lizardbyte.dev/support) for support issues. Thanks. | ||
close: true | ||
lock: true | ||
lock-reason: 'off-topic' | ||
unlabel: 'status:awaiting-triage' | ||
|
||
-invalid:support: | ||
reopen: true | ||
unlock: true | ||
|
||
invalid:template-incomplete: | ||
issues: | ||
comment: > | ||
:wave: @{issue-author}, please edit your issue to complete the template with | ||
all the required info. Your issue will be automatically closed in 5 days if | ||
the template is not completed. Thanks. | ||
prs: | ||
comment: > | ||
:wave: @{issue-author}, please edit your PR to complete the template with | ||
all the required info. Your PR will be automatically closed in 5 days if | ||
the template is not completed. Thanks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,212 @@ | ||
--- | ||
# This action is centrally managed in https://github.com/<organization>/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | ||
# the above-mentioned repo. | ||
|
||
# This workflow will analyze all supported languages in the repository using CodeQL Analysis. | ||
|
||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
schedule: | ||
- cron: '00 12 * * 0' # every Sunday at 12:00 UTC | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
languages: | ||
name: Get language matrix | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.lang.outputs.result }} | ||
continue: ${{ steps.continue.outputs.result }} | ||
steps: | ||
- name: Get repo languages | ||
uses: actions/github-script@v7 | ||
id: lang | ||
with: | ||
script: | | ||
// CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift'] | ||
// Use only 'java' to analyze code written in Java, Kotlin or both | ||
// Use only 'javascript' to analyze code written in JavaScript, TypeScript or both | ||
// Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | ||
const supported_languages = ['cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift'] | ||
const remap_languages = { | ||
'c++': 'cpp', | ||
'c#': 'csharp', | ||
'kotlin': 'java', | ||
'typescript': 'javascript', | ||
} | ||
const repo = context.repo | ||
const response = await github.rest.repos.listLanguages(repo) | ||
let matrix = { | ||
"include": [] | ||
} | ||
for (let [key, value] of Object.entries(response.data)) { | ||
// remap language | ||
if (remap_languages[key.toLowerCase()]) { | ||
console.log(`Remapping language: ${key} to ${remap_languages[key.toLowerCase()]}`) | ||
key = remap_languages[key.toLowerCase()] | ||
} | ||
if (supported_languages.includes(key.toLowerCase())) { | ||
console.log(`Found supported language: ${key}`) | ||
let osList = ['ubuntu-latest']; | ||
if (key.toLowerCase() === 'swift') { | ||
osList = ['macos-latest']; | ||
} else if (key.toLowerCase() === 'cpp') { | ||
// TODO: update macos to latest after the below issue is resolved | ||
// https://github.com/github/codeql-action/issues/2266 | ||
osList = ['macos-13', 'ubuntu-latest', 'windows-latest']; | ||
} | ||
for (let os of osList) { | ||
// set name for matrix | ||
if (osList.length == 1) { | ||
name = key.toLowerCase() | ||
} else { | ||
name = `${key.toLowerCase()}, ${os}` | ||
} | ||
// add to matrix | ||
matrix['include'].push({"language": key.toLowerCase(), "os": os, "name": name}) | ||
} | ||
} | ||
} | ||
// print languages | ||
console.log(`matrix: ${JSON.stringify(matrix)}`) | ||
return matrix | ||
- name: Continue | ||
uses: actions/github-script@v7 | ||
id: continue | ||
with: | ||
script: | | ||
// if matrix['include'] is an empty list return false, otherwise true | ||
const matrix = ${{ steps.lang.outputs.result }} // this is already json encoded | ||
if (matrix['include'].length == 0) { | ||
return false | ||
} else { | ||
return true | ||
} | ||
analyze: | ||
name: Analyze (${{ matrix.name }}) | ||
if: ${{ needs.languages.outputs.continue == 'true' }} | ||
defaults: | ||
run: | ||
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} | ||
env: | ||
GITHUB_CODEQL_BUILD: true | ||
needs: [languages] | ||
runs-on: ${{ matrix.os || 'ubuntu-latest' }} | ||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson(needs.languages.outputs.matrix) }} | ||
|
||
steps: | ||
- name: Maximize build space | ||
if: >- | ||
runner.os == 'Linux' && | ||
matrix.language == 'cpp' | ||
uses: easimon/maximize-build-space@v10 | ||
with: | ||
root-reserve-mb: 30720 | ||
remove-dotnet: ${{ (matrix.language == 'csharp' && 'false') || 'true' }} | ||
remove-android: 'true' | ||
remove-haskell: 'true' | ||
remove-codeql: 'false' | ||
remove-docker-images: 'true' | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Setup msys2 | ||
if: >- | ||
runner.os == 'Windows' && | ||
matrix.language == 'cpp' | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: ucrt64 | ||
update: true | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
|
||
# yamllint disable-line rule:line-length | ||
# 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 | ||
# queries: security-extended,security-and-quality | ||
config: | | ||
paths-ignore: | ||
- node_modules | ||
- third-party | ||
# Pre autobuild | ||
# create a file named .codeql-prebuild-${{ matrix.language }}.sh in the root of your repository | ||
# create a file named .codeql-build-${{ matrix.language }}.sh in the root of your repository | ||
- name: Prebuild | ||
id: prebuild | ||
run: | | ||
# check if prebuild script exists | ||
filename=".codeql-prebuild-${{ matrix.language }}-${{ runner.os }}.sh" | ||
if [ -f "./${filename}" ]; then | ||
echo "Running prebuild script: ${filename}" | ||
./${filename} | ||
fi | ||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). | ||
- name: Autobuild | ||
if: steps.prebuild.outputs.skip_autobuild != 'true' | ||
uses: github/codeql-action/autobuild@v3 | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:${{matrix.language}}" | ||
output: sarif-results | ||
upload: failure-only | ||
|
||
- name: filter-sarif | ||
uses: advanced-security/filter-sarif@v1 | ||
with: | ||
input: sarif-results/${{ matrix.language }}.sarif | ||
output: sarif-results/${{ matrix.language }}.sarif | ||
patterns: | | ||
-node_modules/** | ||
-third\-party/** | ||
- name: Upload SARIF | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: sarif-results/${{ matrix.language }}.sarif | ||
|
||
- name: Upload loc as a Build Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: sarif-results-${{ matrix.language }}-${{ runner.os }} | ||
path: sarif-results | ||
retention-days: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
# This action is centrally managed in https://github.com/<organization>/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | ||
# the above-mentioned repo. | ||
|
||
# Manage stale issues and PRs. | ||
|
||
name: Stale Issues / PRs | ||
|
||
on: | ||
schedule: | ||
- cron: '00 10 * * *' | ||
|
||
jobs: | ||
stale: | ||
name: Check Stale Issues / PRs | ||
if: startsWith(github.repository, 'LizardByte/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Stale | ||
uses: actions/stale@v9 | ||
with: | ||
close-issue-message: > | ||
This issue was closed because it has been stalled for 10 days with no activity. | ||
close-pr-message: > | ||
This PR was closed because it has been stalled for 10 days with no activity. | ||
days-before-stale: 90 | ||
days-before-close: 10 | ||
exempt-all-assignees: true | ||
exempt-issue-labels: 'added,fixed' | ||
exempt-pr-labels: 'dependencies,l10n' | ||
stale-issue-label: 'stale' | ||
stale-issue-message: > | ||
It seems this issue hasn't had any activity in the past 90 days. | ||
If it's still something you'd like addressed, please let us know by leaving a comment. | ||
Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks! | ||
stale-pr-label: 'stale' | ||
stale-pr-message: > | ||
It looks like this PR has been idle for 90 days. | ||
If it's still something you're working on or would like to pursue, | ||
please leave a comment or update your branch. | ||
Otherwise, we'll be closing this PR in 10 days to reduce our backlog. Thanks! | ||
repo-token: ${{ secrets.GH_BOT_TOKEN }} | ||
|
||
- name: Invalid Template | ||
uses: actions/stale@v9 | ||
with: | ||
close-issue-message: > | ||
This issue was closed because the the template was not completed after 5 days. | ||
close-pr-message: > | ||
This PR was closed because the the template was not completed after 5 days. | ||
days-before-stale: 0 | ||
days-before-close: 5 | ||
only-labels: 'invalid:template-incomplete' | ||
stale-issue-label: 'invalid:template-incomplete' | ||
stale-issue-message: > | ||
Invalid issues template. | ||
stale-pr-label: 'invalid:template-incomplete' | ||
stale-pr-message: > | ||
Invalid PR template. | ||
repo-token: ${{ secrets.GH_BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
# This action is centrally managed in https://github.com/<organization>/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in | ||
# the above-mentioned repo. | ||
|
||
# Label and un-label actions using `../label-actions.yml`. | ||
|
||
name: Issues | ||
|
||
on: | ||
issues: | ||
types: [labeled, unlabeled] | ||
discussion: | ||
types: [labeled, unlabeled] | ||
|
||
jobs: | ||
label: | ||
name: Label Actions | ||
if: startsWith(github.repository, 'LizardByte/') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Label Actions | ||
uses: dessant/label-actions@v4 | ||
with: | ||
github-token: ${{ secrets.GH_BOT_TOKEN }} |
Oops, something went wrong.