Zernit/.github/workflows/bash.yml

21 lines
842 B
YAML
Raw Normal View History

2020-02-10 17:56:08 +01:00
name: Bash
2020-02-10 17:06:51 +01:00
# 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:
2020-02-11 19:55:15 +01:00
- uses: actions/checkout@v2
2020-02-11 19:46:39 +01:00
- name: Output changed files hopefully
2020-02-11 19:56:50 +01:00
run: cd "$GITHUB_WORKSPACE" && git ls-tree --name-only -r ${{ github.sha }} ; exit 1
2020-02-10 17:06:51 +01:00
- name: Installing dependencies..
2020-02-11 19:31:44 +01:00
run: if ! apt list --installed 2>/dev/null | grep -q ".*shellcheck.*"; then apt install -y shellcheck; fi
2020-02-10 17:06:51 +01:00
- name: Linting..
2020-02-11 19:59:11 +01:00
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