## Copyright (C) 2012 - 2026 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

## AI-Assisted

name: shell-lint

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  shellcheck:
    name: ShellCheck
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd  # v6.0.2
        with:
          persist-credentials: false

      - name: Run shellcheck
        uses: org-ai-assisted/developer-meta-files/.github/actions/shellcheck@master
        with:
          paths: 'usr/libexec/msgcollector etc/profile.d'
          ## SC1091/SC1090: external sourced files not followed.
          ## SC2034: variables consumed by sourced libs via indirection
          ##   (e.g. check_is_alpha_numeric reads ${!varname}).
          ## SC2154: variables set by sourced helper libs
          ##   (strings.bsh, msgcollector_shared, ...).
          ## SC2086: intentional word-splitting in pv_wrapper eval and
          ##   handful of callers that export multi-word commands.
          excludes: 'SC1091,SC1090,SC2034,SC2154,SC2086'
          shell: 'bash'
