Skip to content

cli: let devices refine the product name via getMetadata() #502

cli: let devices refine the product name via getMetadata()

cli: let devices refine the product name via getMetadata() #502

Workflow file for this run

name: Code Style Check
on:
pull_request:
paths:
- '**.c'
- '**.cpp'
- '**.h'
- '**.hpp'
- '.clang-format'
jobs:
cpp-linter:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# Runs on pull_request, not pull_request_target: this job needs no write
# access, so it does not need the base-repo token. Feedback goes out via
# the step summary and file annotations, neither of which touches an API.
# Fork PRs therefore work with the read-only token they are granted, and
# untrusted PR code cannot reach anything privileged.
#
# No `repository:` input is needed -- GitHub replicates the PR head into
# the base repo, so the head SHA is fetchable from here.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Run cpp-linter
uses: cpp-linter/cpp-linter-action@8e85cd02c8c3fe3ae527c94b5683fe2366b144ed # v2.20.0
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: 'file'
tidy-checks: '-*'
version: '18'
files-changed-only: true
lines-changed-only: false
# Thread comments need the commits API (contents:write), which a fork
# PR's read-only token cannot use. Feedback goes via step-summary and
# file-annotations instead, which need no permissions at all.
thread-comments: false
step-summary: true
file-annotations: true
extensions: 'c,cpp,h,hpp'
- name: Fail if formatting issues found
if: steps.linter.outputs.clang-format-checks-failed > 0
run: |
echo "::error::Found ${{ steps.linter.outputs.clang-format-checks-failed }} formatting issues"
exit 1