21 lines
845 B
YAML
21 lines
845 B
YAML
name: Bash
|
|
|
|
# Relevant to events - https://help.github.com/en/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows
|
|
on:
|
|
pull_request:
|
|
types: [synchronize, opened, reopened, ready_for_review]
|
|
paths:
|
|
- '**.bash'
|
|
|
|
jobs:
|
|
# Linting
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Output changed files hopefully
|
|
run: cd "$GITHUB_WORKSPACE" && git ls-tree --name-only -r ${{ github.sha }} ; exit 1
|
|
- name: Installing dependencies..
|
|
run: if ! apt list --installed 2>/dev/null | grep -q ".*shellcheck.*"; then apt install -y shellcheck; fi
|
|
- name: Linting..
|
|
run: cd "$GITHUB_WORKSPACE" && for file in $(git ls-tree --name-only -r ${{ github.sha }} | grep '.*\.bash'); do shellcheck --external-sources --shell=bash "$file";done |