https://github.com/suzuki-shunsuke/github-action-format
GitHub Actions to format code and push commit
https://github.com/suzuki-shunsuke/github-action-format
Last synced: about 2 months ago
JSON representation
GitHub Actions to format code and push commit
- Host: GitHub
- URL: https://github.com/suzuki-shunsuke/github-action-format
- Owner: suzuki-shunsuke
- License: mit
- Created: 2021-10-11T04:05:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T12:10:08.000Z (6 months ago)
- Last Synced: 2024-10-29T14:38:47.551Z (6 months ago)
- Language: Shell
- Size: 274 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-action-format
GitHub Actions to format code and push commit
This action executes the given command to format code.
If code isn't changed, this means code is originally formatted, so the action succeeds.
If code is changed, this means code isn't originally formatted, so the action fails.
If code is changed and the input `skip_push` is `false`, this action commits the change and pushes the commit to the remote branch.## Requirements
- [ghcp](https://github.com/int128/ghcp)
## Examples
```yaml
- uses: suzuki-shunsuke/[email protected]
with:
command: terraform fmt -recursive | sed "s|^|${{ inputs.working_directory }}/|"
commit_message: "style: terraform fmt -recursive"
skip_push: ${{ github.event_name != 'pull_request' && ! startsWith(github.event_name, 'pull_request_') }}
```## License
[MIT](LICENSE)