mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-14 11:49:16 +00:00
Enable check for .func files
This commit is contained in:
parent
bedd186320
commit
08d43bfb66
9
.github/workflows/script-formatting.yaml
vendored
9
.github/workflows/script-formatting.yaml
vendored
@ -7,6 +7,7 @@ on:
|
||||
pull_request:
|
||||
paths:
|
||||
- "**/*.sh"
|
||||
- "**/*.func"
|
||||
|
||||
jobs:
|
||||
shfmt:
|
||||
@ -33,9 +34,9 @@ jobs:
|
||||
id: changed-files
|
||||
run: |
|
||||
if ${{ github.event_name == 'pull_request' }}; then
|
||||
echo "files=$(git diff --name-only -r HEAD^1 HEAD | grep '\.sh$' | xargs)" >> $GITHUB_OUTPUT
|
||||
echo "files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep '\.sh$' | xargs)" >> $GITHUB_OUTPUT
|
||||
echo "files=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep -E '\.(sh|func)$' | xargs)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Run shfmt
|
||||
@ -48,13 +49,13 @@ jobs:
|
||||
exit 0
|
||||
else
|
||||
echo "diff=\"$(echo -n "$shfmt_output" | base64 -w 0)\"" >> $GITHUB_OUTPUT
|
||||
echo -e $shfmt_output
|
||||
printf "%s" "$shfmt_output"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Post comment with results
|
||||
if: always() && github.event_name == 'pull_request'
|
||||
uses: actions/github-script@v6
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const result = '${{ job.status }}' === 'success' ? 'success' : 'failure';
|
||||
|
Loading…
Reference in New Issue
Block a user