Skip to content

ci: regenerate docs on push to main with empty-diff guard#605

Open
NickJosevski wants to merge 1 commit into
mainfrom
nj/auto-docs-on-main
Open

ci: regenerate docs on push to main with empty-diff guard#605
NickJosevski wants to merge 1 commit into
mainfrom
nj/auto-docs-on-main

Conversation

@NickJosevski
Copy link
Copy Markdown
Contributor

@NickJosevski NickJosevski commented May 22, 2026

Goal

Run the docs-update workflow on every push to main so docs don't drift between releases. The change is just the trigger: adding branches: [main] and a paths: 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 — specifying tags: alone implicitly excludes all branch pushes. The previous config listed only tags: ['v*'], so no branch push ever triggered the workflow. paths: filters don't apply to tag pushes, so the existing v* 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

  • Merge a change under pkg/cmd/** and confirm a docs PR is opened against OctopusDeploy/docs.
  • Push a v* tag (or wait for the next release) and confirm the release-time docs PR still opens.
  • Confirm a push to main that only touches unrelated paths (e.g. README.md) does not trigger the workflow.

🤖 Generated with Claude Code

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>
@NickJosevski NickJosevski force-pushed the nj/auto-docs-on-main branch from 0064a14 to 0beb1f3 Compare May 22, 2026 11:26
@NickJosevski NickJosevski requested a review from benPearce1 May 22, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant