mirror of
https://github.com/ChrisTitusTech/mybash.git
synced 2026-04-03 11:08:28 +00:00
Bumps [actions/cache](https://github.com/actions/cache) from 4 to 5. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
39 lines
948 B
YAML
39 lines
948 B
YAML
name: Bash Lint
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, ubuntu-20.04]
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Cache ShellCheck
|
|
id: cache-shellcheck
|
|
uses: actions/cache@v5
|
|
with:
|
|
path: /usr/local/bin/shellcheck
|
|
key: ${{ runner.os }}-shellcheck
|
|
restore-keys: |
|
|
${{ runner.os }}-shellcheck
|
|
|
|
- name: Install ShellCheck
|
|
if: steps.cache-shellcheck.outputs.cache-hit != 'true'
|
|
run: sudo apt-get install -y shellcheck
|
|
|
|
- name: Lint Bash scripts
|
|
run: |
|
|
echo "Running ShellCheck..."
|
|
find . -name "*.sh" -print0 | xargs -0 shellcheck -f gcc | tee shellcheck.log
|
|
if grep -q "error:" shellcheck.log; then
|
|
echo "Linting errors found!"
|
|
exit 1
|
|
else
|
|
echo "No linting errors found."
|
|
fi
|