diff --git a/.github/workflows/shell-format.yaml b/.github/workflows/shell-format.yaml deleted file mode 100644 index 5220ec5..0000000 --- a/.github/workflows/shell-format.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: Shell Format -on: - push: - branches: ["master"] -permissions: - contents: write - pull-requests: write -jobs: - shell-format: - name: Shell Format (shfmt) - runs-on: ubuntu-latest - defaults: - run: - shell: bash - steps: - - name: Install shfmt - run: | - sudo apt-get install shfmt -y - - name: Checkout Code - uses: actions/checkout@v7 - with: - ref: ${{ github.head_ref }} - - name: Format, Commit and Push Changes - run: | - BRANCH_NAME="fix/shfmt" - - # Check if the branch exists, and switch to it, otherwise create a new branch - if git rev-parse --verify ${BRANCH_NAME}; then - git checkout ${BRANCH_NAME} - git pull origin master - else - git checkout -b ${BRANCH_NAME} - fi - - # Format Shell Scripts - find . -type f -name "*.sh" -exec shfmt -w -i 4 {} \; - - # Commit and Push - git diff --exit-code || ( - COMMIT_MSG="Format shell scripts with shfmt" - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git add . - git commit -m "${COMMIT_MSG}" # Use the commit message here - git push -f --set-upstream origin ${BRANCH_NAME} - gh pr create --title "${COMMIT_MSG}" --body "This PR formats shell scripts with shfmt." - ) - env: - GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}