Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 852 Bytes

README.md

File metadata and controls

26 lines (18 loc) · 852 Bytes

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