Repository navigation
51 lines (42 loc) · 1.68 KB
/
Copy pathwriting.yml
File metadata and controls
51 lines (42 loc) · 1.68 KB
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
43
44
45
46
47
48
49
50
51
# Report optional wording suggestions for pull request prose.
#
# Suggestions and unsupported-input notices return success.
# Git, usage and configuration errors fail the job.
# The ci workflow runs the tests of the checker.
#
# The description comes from the pull request author, so it reaches the script
# through an environment variable and is never interpolated into a command.
name: writing
on:
# "edited" runs the check again when the description changes.
# A stacked pull request is checked against its own base branch.
pull_request:
types: [opened, edited, reopened, synchronize, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
writing:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
# The check finds the changed prose from the merge base, so it needs the history.
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Set up uv
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
version: "0.13.6"
enable-cache: false
- name: changed prose (warnings only)
env:
BASE_REF: ${{ github.base_ref }}
run: uv run --no-project --python 3.12 python scripts/check_writing.py --base "origin/${BASE_REF}" --github
- name: pull request description (warnings only)
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: printf '%s\n' "$PR_BODY" | uv run --no-project --python 3.12 python scripts/check_writing.py --stdin description --github