Skip to content

GitHub Actions to format code and push commit

License

Notifications You must be signed in to change notification settings

suzuki-shunsuke/github-action-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Examples

- uses: suzuki-shunsuke/github-action-format@v0.2.0
  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

About

GitHub Actions to format code and push commit

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages