diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 0000000..3123f87 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1 @@ +name: 'lavamoat.github.io CodeQL Config' diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..7130439 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,19 @@ +'dependencies': + - changed-files: + - any-glob-to-any-file: + - './package?(-lock).json' + +'chore': + - changed-files: + - any-glob-to-any-file: + - '.*/**' + - 'tsconfig.json' + - 'cspell.json' + - '*.config.js' + - '.*' + +'documentation': + - changed-files: + - any-glob-to-any-file: + - 'public/**' + - 'src/**' diff --git a/.github/workflows/assign-author.yml b/.github/workflows/assign-author.yml new file mode 100644 index 0000000..7940aac --- /dev/null +++ b/.github/workflows/assign-author.yml @@ -0,0 +1,23 @@ +name: Auto Author Assign + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: false + +on: + pull_request_target: # zizmor: ignore[dangerous-triggers] + types: [opened, reopened] + branches: [main] + +permissions: {} + +jobs: + assign-author: + name: Assign PR Author to its Creator + if: github.repository == 'LavaMoat/lavamoat.github.io' + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: toshimaru/auto-author-assign@5cd66f093de6691e0812ef186b7492589b0b7866 # v2.1.2 + diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..b26719d --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,64 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: 'CodeQL' + +on: + push: + branches: [main] + pull_request: + # The branches below must be a subset of the branches above + branches: [main] + schedule: + - cron: '29 10 * * 0' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: {} + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: ['javascript', 'typescript'] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://git.io/codeql-language-support + + steps: + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 + 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. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + config-file: ./.github/codeql/codeql-config.yml + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..2b2bc54 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,21 @@ +name: LabelBot +on: + - pull_request_target + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: false + +permissions: + contents: read + +jobs: + labeler: + if: github.repository == 'LavaMoat/lavamoat.github.io' + name: Automatically label PRs + permissions: + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: Label PRs + uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0 diff --git a/cspell.json b/cspell.json index 0aa67ef..43eba1d 100644 --- a/cspell.json +++ b/cspell.json @@ -55,6 +55,8 @@ "laverna", "virtualizes", "Kipuka", - "radio-canada" + "radio-canada", + "zizmor", + "toshimaru" ] } diff --git a/lint-staged.config.js b/lint-staged.config.js index ab2c1d0..0c82640 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,11 +1,11 @@ export default { - '*.(m?js|ts)': [ + '*.{mjs,js,ts}': [ 'eslint --fix', 'prettier --write', 'cspell lint --no-must-find-files', ], '*.md': ['markdownlint-cli2 --fix', 'cspell lint --no-must-find-files'], - '*.(mdx?|ya?ml|json|astro)': [ + '*.{mdx,yml,yaml,json,astro}': [ 'prettier --write', 'cspell lint --no-must-find-files', ],