Skip to content

fix: only apply fuzzy matching if no exact match is found #61

fix: only apply fuzzy matching if no exact match is found

fix: only apply fuzzy matching if no exact match is found #61

Workflow file for this run

name: PR Linting and Formatting
on:
pull_request:
paths:
- "**.sh"
- "**/Dockerfile"
jobs:
lint-and-format-bash:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: "."
severity: "error"
- name: Install shfmt
run: |
go install mvdan.cc/sh/v3/cmd/shfmt@latest
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Run shfmt
run: |
shfmt_output=$(shfmt -d . || true)
if [ -n "$shfmt_output" ]; then
echo "The following files are not correctly formatted:"
echo "$shfmt_output"
echo "Please run 'shfmt -w .' to fix these issues."
exit 1
else
echo "All files are correctly formatted."
fi
lint-dockerfile:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Hadolint
run: |
sudo wget -O /usr/local/bin/hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64
sudo chmod +x /usr/local/bin/hadolint
- name: Run Hadolint on Dockerfiles
run: |
find . -name Dockerfile | while read dockerfile; do
echo "Linting $dockerfile"
if ! hadolint "$dockerfile"; then
echo "Hadolint failed on $dockerfile"
exit 1
fi
done
lint-results:
needs: [lint-and-format-bash, lint-dockerfile]
runs-on: ubuntu-latest
steps:
- name: Check lint results
run: |
echo "All linting and formatting checks completed. Please review any reported issues."