2022-11-17 04:06:42 -05:00
|
|
|
name: Shellfmt
|
2022-11-10 10:14:57 -05:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- "release/**"
|
|
|
|
paths:
|
|
|
|
- "**.sh"
|
|
|
|
- "**.bash"
|
|
|
|
pull_request:
|
|
|
|
paths:
|
|
|
|
- "**.sh"
|
|
|
|
- "**.bash"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
shellcheck:
|
|
|
|
name: Shellfmt
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-12-14 08:55:14 -05:00
|
|
|
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
|
2022-11-10 10:14:57 -05:00
|
|
|
with:
|
|
|
|
ref: ${{ github.head_ref }}
|
|
|
|
|
|
|
|
- name: Setup Go environment
|
2022-12-14 08:55:14 -05:00
|
|
|
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
|
2022-11-10 10:14:57 -05:00
|
|
|
with:
|
2022-12-07 08:27:43 -05:00
|
|
|
go-version: "1.19.4"
|
2022-11-10 10:14:57 -05:00
|
|
|
|
|
|
|
- name: Install shellfmt
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-11-17 08:38:01 -05:00
|
|
|
go install github.com/katexochen/sh/v3/cmd/shfmt@latest
|
2022-11-10 10:14:57 -05:00
|
|
|
|
|
|
|
- name: Run shellfmt
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-11-14 07:20:36 -05:00
|
|
|
# shellcheck disable=SC2046
|
|
|
|
shfmt -i 2 -d -s -sr $(shfmt -f . | grep -v helm/charts/cilium)
|