https://github.com/ryohidaka/action-sh-format
GitHub Actions to formats shell scripts using shfmt.
https://github.com/ryohidaka/action-sh-format
custom-actions formatter github-actions shell-script shfmt
Last synced: 7 months ago
JSON representation
GitHub Actions to formats shell scripts using shfmt.
- Host: GitHub
- URL: https://github.com/ryohidaka/action-sh-format
- Owner: ryohidaka
- License: mit
- Created: 2024-09-11T00:07:19.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-27T12:23:59.000Z (9 months ago)
- Last Synced: 2025-01-27T13:38:29.915Z (9 months ago)
- Topics: custom-actions, formatter, github-actions, shell-script, shfmt
- Language: Shell
- Homepage: https://github.com/marketplace/actions/shellscript-formatter
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ShellScript Formatter

[](https://github.com/ryohidaka/action-sh-format/actions/workflows/test.yml)
[](https://opensource.org/licenses/MIT)A GitHub Action that formats shell scripts using [shfmt](https://github.com/mvdan/sh).
## Usage
```yml
on:
push:
branches:
- mainjobs:
format-shell-scripts:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: ryohidaka/action-sh-format@v0.3.2
with:
path: "."
indent: 4
commit-user-name: "GitHub Actions"
commit-user-email: "actions@github.com"
commit-message: "chore: Format ShellScripts"
dry-run: false
```## Inputs
| Input | Description | Required | Default |
| ------------------- | --------------------------------------------------- | -------- | ---------------------------- |
| `path` | Directory path to format shell scripts. | ✅ | `.` |
| `indent` | Set the indentation level for shfmt. | | `4` |
| `commit-user-name` | Commit username. | | `GitHub Actions` |
| `commit-user-email` | Commit email. | | `actions@github.com` |
| `commit-message` | Commit message. | | `chore: Format ShellScripts` |
| `dry-run` | If true, the commit and push steps will be skipped. | | `false` |## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.