Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches: [ main ]
pull_request_target:
pull_request:
branches: [ '*' ]

jobs:
Expand All @@ -19,14 +19,6 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
# Check out the pull request repository and branch.
# If the PR is made from a fork, this will check out the fork.
# This is necessary for git-auto-commit-action to update PRs made by forks.
# See
# https://github.com/stefanzweifel/git-auto-commit-action#use-in-forks-from-public-repositories
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}

- name: Check or update style.md
uses: abhinav/stitchmd-action@v1
Expand All @@ -36,13 +28,13 @@ jobs:
# without a local checkout.
#
# Otherwise, run in 'check' mode to fail CI if style.md is out-of-date.
mode: ${{ github.event_name == 'pull_request_target' && 'write' || 'check' }}
mode: ${{ github.event_name == 'pull_request' && 'write' || 'check' }}
summary: src/SUMMARY.md
preface: src/preface.txt
output: style.md

- uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ github.event_name == 'pull_request_target' }}
if: ${{ github.event_name == 'pull_request' }}
with:
file_pattern: style.md
commit_message: 'Auto-update style.md'
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ and get agreement on the general direction of the change.
- Use tables for side-by-side code samples.
- Link to other sections with their file names (`[..](foo.md)`).

## Updating style.md

`style.md` is generated from the contents of `src/` using [stitchmd](https://github.com/abhinav/stitchmd).
If CI fails because `style.md` is out of date, regenerate it by running:

```bash
make
```

This will install `stitchmd` if needed and update `style.md`.
Commit the result and push it to your branch.

## Writing style

### Line breaks
Expand Down
Loading