Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Run pre-commit

on:
workflow_call:
inputs:
inputs:
commands:
required: false
type: string
Expand All @@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
id: python-setup
with:
python-version: '3.x'
python-version: "3.x"
- name: Run commands
if: inputs.commands
run: ${INPUTS_COMMANDS}
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Cache pre-commit environments
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
with:
path: '~/.cache/pre-commit'
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

Expand All @@ -55,6 +55,15 @@ jobs:
persist-credentials: false
repository: cpp-linter/.github
path: org-repo
- name: Get PR title
id: get-title
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |-
pr_title=$(gh pr view "${PR_NUMBER}" --repo "${GH_REPO}" --json "title" -q ".title")
echo "title=${pr_title}" >> "${GITHUB_OUTPUT}"
- run: rustup update --no-self-update
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@2bb61346d075e720d4c3da92f23b6d612d5a7543 # v1.15.3
Expand All @@ -64,15 +73,14 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
- name: conventional-commit
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: >-
echo "${PR_TITLE}"
| committed --config ${{ github.workspace }}/org-repo/.github/committed.toml --commit-file -
PR_TITLE: "${{ steps.get-title.outputs.title }}"
COMMITTED_CONFIG: ${{ github.workspace }}/org-repo/.github/committed.toml
run: echo "${PR_TITLE}" | committed --config "${COMMITTED_CONFIG}" --commit-file -
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: latest
- name: spell check
working-directory: project-repo
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_TITLE: "${{ steps.get-title.outputs.title }}"
run: echo "${PR_TITLE}" | npx cspell-cli lint stdin