-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (32 loc) · 1.08 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: CI
on: [push, pull_request]
jobs:
lint_newlines:
name: Lint newlines
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
- name: Lint newlines
id: lint_newlines
uses: fionn/newline-linter@master
- name: Comment on PR
uses: actions/github-script@v7
if: |
failure() && steps.lint_newlines.outcome == 'failure'
&& github.event_name == 'pull_request' && github.event.action == 'opened'
with:
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `Some files do not end in newlines. \
See [_No Newline at End of File_](https://thoughtbot.com/blog/no-newline-at-end-of-file) \
for how to fix your editor configuration.`
})