mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
ci: remove committing from CheckScripts.yml
This commit is contained in:
parent
a0f6df4b79
commit
5eb1fd0b02
1 changed files with 1 additions and 19 deletions
20
.github/workflows/CheckScripts.yml
vendored
20
.github/workflows/CheckScripts.yml
vendored
|
@ -41,14 +41,9 @@ jobs:
|
||||||
|
|
||||||
shell_fmt:
|
shell_fmt:
|
||||||
name: ShellScript/Format
|
name: ShellScript/Format
|
||||||
# no need to run in pr events
|
|
||||||
# shfmt will be performed on main branch when the PR is merged
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ shell_check ]
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: read
|
||||||
pull-requests: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup shfmt
|
- name: Setup shfmt
|
||||||
|
@ -56,19 +51,6 @@ jobs:
|
||||||
- name: Run shfmt
|
- name: Run shfmt
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# show differs first for every files that need to be formatted
|
|
||||||
# fmt options: bash syntax, 4 spaces indent, indent for switch-case
|
# fmt options: bash syntax, 4 spaces indent, indent for switch-case
|
||||||
echo "## show the differences between formatted and original scripts..."
|
echo "## show the differences between formatted and original scripts..."
|
||||||
find ${{ env.SCRIPT_DIR }} -name "*.sh" -print0 | xargs -0 shfmt -ln=bash -i 4 -ci -d || true
|
find ${{ env.SCRIPT_DIR }} -name "*.sh" -print0 | xargs -0 shfmt -ln=bash -i 4 -ci -d || true
|
||||||
# perform a shell format
|
|
||||||
echo "## perform a shell format..."
|
|
||||||
# ignore the error code because `-d` will always return false when the file has difference
|
|
||||||
find ${{ env.SCRIPT_DIR }} -name "*.sh" -print0 | xargs -0 shfmt -ln=bash -i 4 -ci -w
|
|
||||||
- name: Commit any changes
|
|
||||||
uses: EndBug/add-and-commit@v9
|
|
||||||
with:
|
|
||||||
default_author: github_actions
|
|
||||||
message: "style: auto format by CI (shfmt)"
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue