ci: regenerate docs on push to main with empty-diff guard#605
Open
NickJosevski wants to merge 1 commit into
Open
ci: regenerate docs on push to main with empty-diff guard#605NickJosevski wants to merge 1 commit into
NickJosevski wants to merge 1 commit into
Conversation
Adds push-to-main with a path filter scoped to dirs that affect generated docs, so docs PRs are opened between releases without relying on manual dispatch. Tag-push behaviour is preserved — GitHub does not apply paths filters to tag pushes, so the existing v* release trigger still fires unconditionally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0064a14 to
0beb1f3
Compare
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.
Goal
Run the docs-update workflow on every push to
mainso docs don't drift between releases. The change is just the trigger: addingbranches: [main]and apaths:filter scoped to dirs that affect generated docs (cmd/gen-docs/**,pkg/cmd/**,go.mod,go.sum, the workflow file). Net diff is 9 lines.Follow-up from #591.
Why specify
branches: [main]rather than omitting the filter?GitHub's
push:filter is asymmetric — specifyingtags:alone implicitly excludes all branch pushes. The previous config listed onlytags: ['v*'], so no branch push ever triggered the workflow.paths:filters don't apply to tag pushes, so the existingv*release trigger continues to fire unconditionally. (GitHub docs: "If you only define one of the two (tags or branches), the workflow won't run for events affecting the undefined Git ref.")Test plan
pkg/cmd/**and confirm a docs PR is opened againstOctopusDeploy/docs.v*tag (or wait for the next release) and confirm the release-time docs PR still opens.mainthat only touches unrelated paths (e.g.README.md) does not trigger the workflow.🤖 Generated with Claude Code