Files
hassio-addons/.github/workflows/weekly_bashbeautify.yaml
2023-12-24 04:37:32 +01:00

43 lines
1.0 KiB
YAML

name: Weekly bash beautify
on:
schedule:
- cron: "0 0 * * 0"
workflow_dispatch:
concurrency:
group: lint-bash-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
lint-bash:
name: Lint Bash Scripts
runs-on: ubuntu-latest
steps:
- name: Checkout Git Repository
uses: actions/checkout@v4
- name: Set up Python Environment
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Beautysh
run: pip install beautysh
- name: Run Beautysh
run: |
find . -name '*.sh' -print0 | xargs -0 beautysh --indent-size 4
shopt -s globstar nullglob
if compgen -G "**/*.sh" > /dev/null; then
beautysh **/*.sh --indent-size 4 --check
fi
shopt -u globstar nullglob
- name: Commit if needed
uses: EndBug/add-and-commit@v9
with:
message: "Github bot : script beautyshied"
default_author: github_actions