Test linting #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" |