Skip to content

Commit a15c388

Browse files
simisonsimisonciampo
authored andcommitted
Changelog validator: ignore markdown & configs d46223 (WordPress#83618)
Co-authored-by: simison <simison@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org>
1 parent a1c0935 commit a15c388

1 file changed

Lines changed: 27 additions & 1 deletion

File tree

‎.github/workflows/check-package-changelogs.yml‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,23 @@ on:
4141
- 'packages/widget-dashboard/**'
4242
- 'packages/widget-primitives/**'
4343
- 'packages/wp-build/**'
44+
- '!packages/*/**/*.md'
4445
- 'packages/*/CHANGELOG.md'
4546
- 'tools/validation/validate-changelogs.ts'
4647
- '.github/workflows/check-package-changelogs.yml'
4748
- '!packages/*/**/stories/**'
4849
- '!packages/*/**/test/**'
4950
- '!packages/*/**/__tests__/**'
51+
- '!packages/*/**/*.stories.*'
52+
- '!packages/*/**/*.mdx'
53+
- '!packages/*/**/storybook.d.ts'
54+
- '!packages/*/tsconfig.stories.json'
55+
- '!packages/*/tsconfig.test.json'
56+
- '!packages/*/tsconfig.bin.json'
57+
- '!packages/*/.stylelintrc*'
58+
- '!packages/*/.eslintrc*'
59+
- '!packages/*/.prettierrc*'
60+
- '!packages/*/.gitignore'
5061

5162
# Disable permissions for all available scopes by default.
5263
# Any needed permissions should be configured at the job level.
@@ -127,8 +138,23 @@ jobs:
127138
# The workflow's `paths:` filter triggers on the union of all
128139
# tracked packages, so this matrix entry may run on a PR that
129140
# doesn't touch its package. Short-circuit if that's the case.
141+
# Files that don't warrant a CHANGELOG entry:
142+
ignored="^${PACKAGE_PATH}/("
143+
# Tests and stories.
144+
ignored+="(.+/)?(stories|test|__tests__)/"
145+
# Markdown: docs, READMEs and the CHANGELOG itself.
146+
ignored+="|.+\.(md|mdx)$"
147+
# Storybook files outside a stories directory.
148+
ignored+="|(.+/)?([^/]+\.stories\.[^/]+|storybook\.d\.ts)$"
149+
# Dev tooling configs at the package root. Configs a package
150+
# ships, such as `packages/scripts/config/`, and TypeScript
151+
# configs that can affect the build (`tsconfig.json`,
152+
# `tsconfig.build.json`, `tsconfig.plugins.json`) still count.
153+
ignored+="|(tsconfig\.(stories|test|bin)\.json|\.(stylelintrc|eslintrc|prettierrc)[^/]*|\.gitignore)$"
154+
ignored+=")"
155+
130156
relevant_changes=$(git diff --name-only "$BASE_SHA"...HEAD -- "${PACKAGE_PATH}/" \
131-
| grep -Ev "^${PACKAGE_PATH}/((.+/)?(stories|test|__tests__)/|CHANGELOG\.md$)" || true)
157+
| grep -Ev "$ignored" || true)
132158
133159
if [ -z "$relevant_changes" ]; then
134160
echo "No relevant changes under ${PACKAGE_PATH}; skipping CHANGELOG presence check."

0 commit comments

Comments
 (0)