ci(docs): always trigger docs workflow on PRs; move filtering into workflow#1544
Merged
Merged
Conversation
- Drop the `paths` trigger filters so the docs workflow always runs on pull requests (and pushes) and reliably reports its check status. - Add a `changes` job using dorny/paths-filter@v3 to detect doc-related changes inside the workflow with recursive globs (`flaml/**`, `website/**`, `.github/workflows/deploy-website.yml`). - Gate `checks` and `gh-release` on the filter output so the heavy steps are skipped when no doc-related files changed, while `workflow_dispatch` (and `merge_group` for `checks`) can still force a run. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jianglibigdata
approved these changes
May 9, 2026
There was a problem hiding this comment.
Pull request overview
Adjusts the docs GitHub Actions workflow so it always triggers on PRs/pushes (avoiding “expected but not run” required-check deadlocks) while keeping expensive docs build/deploy steps conditional on doc-related file changes detected inside the workflow.
Changes:
- Removed trigger-level
pathsfilters so the workflow always starts onpull_requestandpushtomain. - Added a
changesjob usingdorny/paths-filter@v3with recursive globs to detect doc-related changes. - Gated
checksandgh-releasejobs on thechangesjob output (with overrides forworkflow_dispatch/merge_groupwhere applicable).
…ents:write to deploy Address review: dorny/paths-filter@v3 calls the GitHub PR Files API on pull_request events and needs `pull-requests: read`. Without it, the `changes` job can fail with 403 on PRs and block downstream jobs via `needs: changes`. - Drop workflow-level `contents: write`; default to least-privilege `contents: read` and add `pull-requests: read` so the filter can read PR file lists. - Move `contents: write` to the `gh-release` job only, where peaceiris/actions-gh-pages needs it to push to the gh-pages branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…read Per review feedback, restore `contents: write` at the workflow level (needed by gh-release for peaceiris/actions-gh-pages to push to gh-pages) and just additively grant `pull-requests: read` so dorny/paths-filter@v3 can read PR file lists via the GitHub API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jianglibigdata
approved these changes
May 9, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Today the
docsworkflow uses trigger-levelpathsfilters. When a PR doesn't touch any of those paths, GitHub never starts the workflow, so thedocscheck is reported as expected but not run — which can leave required-status-check rules waiting indefinitely and makes branch-protection harder to manage.What
pathsfilters from both thepull_requestandpushtriggers so the workflow always starts on PRs (and on pushes tomain) and reliably reports a check status.changesjob that usesdorny/paths-filter@v3to detect doc-related changes inside the workflow, with recursive globs:flaml/**website/**.github/workflows/deploy-website.ymlchecksandgh-releasejobs onneeds.changes.outputs.docsso the heavy build/deploy steps are still skipped when nothing relevant changed (preserving today's compute behavior).workflow_dispatch(andmerge_groupforchecks) can still force a run regardless of the filter.The previous
flaml/*/website/*patterns only matched files in the top of those directories — switching to**ensures changes anywhere in the tree are picked up.Behavior matrix
changeschecksgh-releasepull_requestpushtomainworkflow_dispatchmerge_group