-
Notifications
You must be signed in to change notification settings - Fork 13
36 lines (35 loc) · 1.26 KB
/
vale.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
name: Lint prose with Vale
on:
issue_comment:
types: [created]
jobs:
vale:
if: ${{ github.event.issue.pull_request && github.event.issue.state == 'open' && contains(github.event.comment.body, '/vale') }}
runs-on: ubuntu-latest
container:
image: grafana/vale:latest
steps:
- uses: actions/github-script@v7
with:
# Not a separate file because then it doesn't have to wait for a checkout to be run.
script: |
await github.request('POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions', {
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'eyes',
});
- uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.issue.number }}/head
- uses: actions/github-script@v7
id: from-comment
with:
script: |
const script = require('./.github/workflows/from-comment.js');
await script({ core, context, github });
- name: Run linter
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TO_LINT: ${{ steps.from-comment.outputs.to-lint }}
run: echo "${TO_LINT}"