Skip to content

Auto-commit: 0 added, 2 modified, 0 deleted #54

Auto-commit: 0 added, 2 modified, 0 deleted

Auto-commit: 0 added, 2 modified, 0 deleted #54

Workflow file for this run

- name: Cache shellcheck and shfmt
uses: actions/cache@v2
with:
path: ~/tools
key: ${{ runner.os }}-shell-tools
restore-keys: |
${{ runner.os }}-shell-tools

Check failure on line 8 in .github/workflows/lint.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/lint.yml

Invalid workflow file

You have an error in your yaml syntax on line 8
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install shellcheck
run: |
sudo pacman -Su shellcheck --noconfirm
mkdir -p ~/tools && cp $(which shellcheck) ~/tools
- name: Install shfmt
run: |
wget https://github.com/mvdan/sh/releases/download/v3.4.1/shfmt_v3.4.1_linux_amd64 -O shfmt
chmod +x shfmt
sudo mv shfmt /usr/local/bin/
cp /usr/local/bin/shfmt ~/tools
- name: Run shfmt
run: |
shfmt -l -w .
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git add .
git commit -m "Automated code formatting" || echo "No changes to commit"
- name: Run shellcheck
run: |
scripts=$(find . -type f -name "*.sh")
for script in $scripts; do
shellcheck "$script"
done