diff --git a/.github/committed.toml b/.github/committed.toml new file mode 100644 index 0000000..ae10d05 --- /dev/null +++ b/.github/committed.toml @@ -0,0 +1,20 @@ +# https://github.com/crate-ci/committed/blob/master/docs/reference.md +style = "conventional" +subject_capitalized = false +allowed_types = [ + "fix", + "feat", + "build", + "chore", + "docs", + "style", + "refactor", + "remove", + "deprecate", + "security", + "add", + "perf", + "test", +] +subject_length = 0 # unlimited +line_length = 0 # unlimited diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 9ad2bd6..96c863f 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -13,8 +13,10 @@ jobs: run-pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5 - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5 + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 id: python-setup with: python-version: '3.x' @@ -22,8 +24,51 @@ jobs: if: inputs.commands run: ${{ inputs.commands }} - name: Cache pre-commit environments - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 #v4 + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: '~/.cache/pre-commit' key: pre-commit-${{ steps.python-setup.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }} - run: pipx run pre-commit run --show-diff-on-failure --color=always --all-files + + check-pr-title: + name: Check PR title + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + # The calling workflow must grant these permissions. + permissions: + contents: read + steps: + - name: Checkout ${{ github.repository }} repo + # needed for cspell.config.yml (project-specific) + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + repository: ${{ github.repository }} + ref: ${{ github.sha }} + path: project-repo + - name: Checkout cpp-linter/.github (org) repo + # needed for committed.toml config (org-specific) + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + repository: cpp-linter/.github + path: org-repo + - run: rustup update --no-self-update + - name: Install cargo-binstall + uses: cargo-bins/cargo-binstall@2bb61346d075e720d4c3da92f23b6d612d5a7543 # v1.15.3 + - name: Install committed + run: cargo binstall -y committed + env: + GITHUB_TOKEN: ${{ github.token }} + - name: conventional-commit + run: >- + echo "${{ github.event.pull_request.title }}" + | committed --config ${{ github.workspace }}/org-repo/.github/committed.toml --commit-file - + - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 + with: + node-version: latest + - name: spell check + working-directory: project-repo + run: >- + echo "${{ github.event.pull_request.title }}" + | npx cspell-cli lint stdin diff --git a/.github/workflows/snyk-container.yml b/.github/workflows/snyk-container.yml index c93fa87..27f4987 100644 --- a/.github/workflows/snyk-container.yml +++ b/.github/workflows/snyk-container.yml @@ -14,7 +14,7 @@ jobs: env: # In order to use the Snyk Action you will need to have a Snyk API token. # More details in https://github.com/snyk/actions#getting-your-snyk-token - # or you can signup for free at https://snyk.io/login + # or you can sign up for free at https://snyk.io/login SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }} with: image: xianpengshen/clang-tools:all diff --git a/cspell.config.yml b/cspell.config.yml new file mode 100644 index 0000000..1c32ea5 --- /dev/null +++ b/cspell.config.yml @@ -0,0 +1,25 @@ +version: "0.2" +language: en +words: + - Abril + - autobuild + - autolabeler + - binstall + - Fatface + - htmlcov + - mkdocs + - peaceiris + - pipx + - pypi + - rustup + - sarif + - setuptools + - testpypi + - venv + - xianpengshen +ignorePaths: + - .env/** + - .venv/** + - env/** + - venv/** + - .gitignore diff --git a/profile/README.md b/profile/README.md index 5554172..3944ff2 100644 --- a/profile/README.md +++ b/profile/README.md @@ -1,3 +1,5 @@ + +