Skip to content

[OCE-Build] Fix shellcheck errors #2

[OCE-Build] Fix shellcheck errors

[OCE-Build] Fix shellcheck errors #2

Workflow file for this run

name: Analyze
on:
# Skips build process for changes to only **docs** or **.github** directories.
push:
branches:
- 'main'
paths:
- '!.github/**'
- '!docs/**'
- '!.gitmodules'
- '!.gitattributes'
- '!.gitignore'
- 'scripts/**'
# Enables trigger for pull requests when making changes to **src** directory.
pull_request:
branches:
- 'main'
- 'development'
paths:
- 'scripts/**'
workflow_dispatch:
jobs:
shellcheck:
name: Run Shellcheck
timeout-minutes: 2
runs-on: ubuntu-latest
steps:
# Fetches remote repository without --progress option.
#
# The default behavior of @actions/checkout outputs many noisy lines of
# status output in the workflow log, which is problematic for log size.
#
# Refer to the below PR for updates on this issue:
# - https://github.com/actions/checkout/pull/1067
- name: Checkout latest repository commit
# uses: actions/checkout@v3
uses: simonbaird/checkout@no-progress-option
with:
show-progress: false
submodules: recursive
# Installs shellcheck dependency.
- name: Install Shellcheck dependencies
shell: bash
run: |
scversion="latest"
wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv
sudo cp "shellcheck-${scversion}/shellcheck" /usr/bin/
# Run shellcheck on each .tool/.command/.sh file with info verbosity.
- name: Run shellcheck
run: find . \( -name "*.sh" -o -name "*.command" \) -exec sh -c 'for TargetFile; do shellcheck --severity=info "${TargetFile}" || exit 1; done' sh {} +