Skip to content

Commit 9a0b054

Browse files
Automatically comment if a PR doesn't meet the style guide (#453)
1 parent 148a186 commit 9a0b054

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Zola
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: source
6+
pull_request:
47

58
jobs:
69
zola:
@@ -18,6 +21,17 @@ jobs:
1821
with:
1922
args: '.'
2023
config: '.markdownlint.json'
24+
- name: Comment if lints failed
25+
if: failure() && github.base_ref # base_ref is only set for PRs
26+
uses: actions/github-script@v3
27+
with:
28+
script: |
29+
github.issues.createComment({
30+
owner: context.repo.owner,
31+
repo: context.repo.repo,
32+
issue_number: context.issue.number,
33+
body: "It looks like the MarkdownLint checks for this PR have failed. Please take a look at the 'Checks' tab to see what needs changing."
34+
});
2135
- name: Install Zola
2236
run: curl -L ${BASE_URL}/${VERS}/zola-${VERS}-${ARCH}.tar.gz | tar -xz
2337
- run: ./zola --version

0 commit comments

Comments
 (0)