-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vatsal Gupta
committed
Nov 23, 2024
1 parent
897f478
commit d553933
Showing
6 changed files
with
89 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Shell Format | ||
on: | ||
pull_request: | ||
branches: ["*"] | ||
push: | ||
branches: | ||
- master | ||
permissions: | ||
contents: write # Grant write permission only for contents (commit/push) | ||
jobs: | ||
shell-format: | ||
name: Shell Format (shfmt) | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Install shfmt | ||
run: | | ||
sudo apt-get install shfmt -y | ||
- name: Format Shell Scripts | ||
run: | | ||
find . -type f -name "*.sh" -exec shfmt -w {} \; | ||
- name: Commit and Push Changes | ||
run: | | ||
git diff --exit-code || ( | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit -m "Format shell scripts with shfmt" | ||
git push origin HEAD | ||
) | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters