Skip to content

A GitHub Action that automatically fixes files without a new line at the end in pull requests.

License

Notifications You must be signed in to change notification settings

Logerfo/newline-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Dependencies Status

Newline Action

This action will automatically fix files without a final new line in pull requests.
Only works for UTF-8 files.

Setting up

Create a file named .github/workflows/newline.yml.

Minimal configuration

name: Final new line
on:
  pull_request:
    types: [synchronize, opened]
jobs:
  build:
    name: New line
    runs-on: ubuntu-16.04
    steps:
      - uses: actions/checkout@master
      - uses: Logerfo/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }} # The `GITHUB_TOKEN` secret.

Complete configuration

All values are default.

name: Final new line
on:
  pull_request:
    types: [synchronize, opened]
jobs:
  build:
    name: New line
    runs-on: ubuntu-16.04
    steps:
      - uses: actions/checkout@master
      - uses: Logerfo/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }} # The `GITHUB_TOKEN` secret.
          config-path: .github/newline.yml # The path of the addtional configurations file.

Additional configurations file

You can optionally create a additional configuration file. The default path is .github/newline.yml, but you can change it in the action configuration file, as shown above.
All values are default.

autoCommit: true # If false, the bot will still comment in the pull request, so you can known which files are wrong and fix them yourself.
ignorePaths: ["bin/**", "node_modules/**", "out/**"] # Globs to be ignored

Auto update

You can use (at your own risk) the release branch instead of the specific version tag.
Never user master, since the distribution file does not exist in this branch and the action will always fail.

Changelog

Click here.

Contributing

If you have suggestions for how close-label could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

Donate

BTC: 1LoGErFoNzE1gCA5fzk6A82nV6iJdKssSZ