mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-15 20:29: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:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "**/*.sh"
|
- "**/*.sh"
|
||||||
|
- "**/*.func"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
shfmt:
|
shfmt:
|
||||||
@ -33,9 +34,9 @@ jobs:
|
|||||||
id: changed-files
|
id: changed-files
|
||||||
run: |
|
run: |
|
||||||
if ${{ github.event_name == 'pull_request' }}; then
|
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
|
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
|
fi
|
||||||
|
|
||||||
- name: Run shfmt
|
- name: Run shfmt
|
||||||
@ -48,13 +49,13 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "diff=\"$(echo -n "$shfmt_output" | base64 -w 0)\"" >> $GITHUB_OUTPUT
|
echo "diff=\"$(echo -n "$shfmt_output" | base64 -w 0)\"" >> $GITHUB_OUTPUT
|
||||||
echo -e $shfmt_output
|
printf "%s" "$shfmt_output"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Post comment with results
|
- name: Post comment with results
|
||||||
if: always() && github.event_name == 'pull_request'
|
if: always() && github.event_name == 'pull_request'
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const result = '${{ job.status }}' === 'success' ? 'success' : 'failure';
|
const result = '${{ job.status }}' === 'success' ? 'success' : 'failure';
|
||||||
|
Loading…
Reference in New Issue
Block a user