Skip to content
Merged
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
35 changes: 35 additions & 0 deletions .github/workflows/docs-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Keep docs manifest up to date
on:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The on config here is what diverges the most from the other workflows. Initially, based on Gutenberg's components-changelog workflow, I wanted this check to be more conservative.

But now that I look at it again, and given the approach I finally took, maybe it should be the same as in the others. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me like this. What do you think could be different?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure about the preferences — if any — for the branches property, nor about which workflows should also run on push events. But I'm about to push a simplification here, limiting the workflow to pull_request events and looking more like other workflows.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request events sound good, regenerating the manifest should be enforces for PRs that target trunk 👍

pull_request:
branches:
- trunk
paths:
- docs/**

jobs:
check-docs-manifest:
name: Check docs manifest for staleness
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
tools: composer:v2

- name: Regenerate manifest
run: composer run docs:manifest

- name: Check whether manifest has been updated
env:
MANIFEST_PATH: docs/bin/manifest.json
run: |
if ! git diff --quiet -- "$MANIFEST_PATH"; then
echo "There are documentation changes in this branch that require that the docs manifest be regenerated."
echo
echo "Please run 'composer run docs:manifest' and commit $MANIFEST_PATH"
exit 1
fi
Loading