Skip to content

InsightSoftwareConsortium/ITKApplyClangFormatAction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ITK Apply clang-format Action

This GitHub Action applies clang-format on a PR when requested by adding the label action:ApplyClangFormat.

The bot will run clang-format on the current topic branch with ITK's configuration, force-push the result, and remove the label.

Note: As of 2020-01-08, this action currently does not work from forked repositories because the GITHUB_TOKEN has limited permissions. Branches need to be created on the upstream repository.

Usage

Add the following configuration to your project's repository at, e.g., .github/workflows/apply-clang-format.yml.

name: Apply clang-format to PR

on:
  pull_request:
    types: [labeled]

jobs:
  clang-format:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - uses: InsightSoftwareConsortium/ITKApplyClangFormatAction@testing
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}

To change the name of the label used to trigger the formatting, set the label-name input. For example:

    - uses: InsightSoftwareConsortium/ITKApplyClangFormatAction@testing
      with:
        label-name: 'action:MakeItStylish'
        github-token: ${{ secrets.GITHUB_TOKEN }}

See Also

ITKClangFormatLinterAction

About

GitHub Action to apply clang-format on a PR when a label is applied.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published