Skip to content

Add a sync job to push docs changes to the kitops repo#1

Merged
javisperez merged 3 commits intomainfrom
sync-docs-to-kitops
Mar 20, 2026
Merged

Add a sync job to push docs changes to the kitops repo#1
javisperez merged 3 commits intomainfrom
sync-docs-to-kitops

Conversation

@javisperez
Copy link
Copy Markdown
Collaborator

This pull request introduces automation for syncing documentation changes from the kitops-ts repository to the main KitOps repository. The workflow ensures that any updates to the documentation in kitops-ts are automatically copied and a pull request is opened in the KitOps repository, streamlining the process and reducing manual effort.

Documentation sync automation:

  • Added .github/workflows/docs-sync.yml to trigger a sync workflow when changes are pushed to the docs directory on the main branch.
  • Added .github/workflows/sync-docs-to-kitops.yml workflow to handle the actual syncing process, including generating a GitHub App token, checking out both repositories, copying documentation files, and opening a pull request in the KitOps repository with the updated docs.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds GitHub Actions automation to sync documentation changes from kitops-ts into the main kitops-ml/kitops repository by copying docs and opening/refreshing a PR.

Changes:

  • Added a push-triggered workflow that runs when docs/** changes on main.
  • Added a reusable workflow that checks out both repos, copies docs into kitops/docs/kitops-ts, and opens a PR in kitops.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/docs-sync.yml Triggers the reusable sync workflow on docs/** changes to main.
.github/workflows/sync-docs-to-kitops.yml Implements the sync logic: token creation, dual checkout, file copy, and PR creation in kitops.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/sync-docs-to-kitops.yml Outdated
Comment thread .github/workflows/docs-sync.yml Outdated
Comment thread .github/workflows/sync-docs-to-kitops.yml Outdated
Comment thread .github/workflows/sync-docs-to-kitops.yml Outdated
Comment thread .github/workflows/sync-docs-to-kitops.yml Outdated
@javisperez javisperez force-pushed the sync-docs-to-kitops branch 2 times, most recently from a2b8512 to 1c4e1e2 Compare March 20, 2026 18:39
Signed-off-by: Javis Pérez <javis@jozu.com>
@javisperez javisperez force-pushed the sync-docs-to-kitops branch from 1c4e1e2 to 76ab90e Compare March 20, 2026 18:40
Signed-off-by: Javis Pérez <javis@jozu.com>
Signed-off-by: Javis Pérez <javis@jozu.com>
Comment on lines +3 to +8
on:
push:
branches:
- main
paths:
- "docs/**"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can just move this trigger into sync-docs-to-kitops.yml and avoid having to call it separately, not entirely sure why this job exists only to call the second job without doing anything else

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Aha I see you've already changed it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yes sir! thanks for the idea 🎉

Comment on lines +3 to +8
on:
workflow_call:
secrets:
KITOPS_BOT_PRIVATE_KEY:
required: true
workflow_dispatch:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

E.g.

Suggested change
on:
workflow_call:
secrets:
KITOPS_BOT_PRIVATE_KEY:
required: true
workflow_dispatch:
on:
push:
branches:
- main
paths:
- "docs/**"
workflow_dispatch:

Comment on lines +31 to +40
- name: Checkout kitops-ts repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Checkout KitOps repository to subdirectory
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ steps.generate-token.outputs.token }}
repository: kitops-ml/kitops
ref: main
path: ${{ env.KITOPS_PATH }}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This can be made a tiny bit cleaner by copying both repos to separate paths (this was will put kitops-clone as a subdirectory in kitops-ts) but it's not terribly important.

@javisperez javisperez merged commit 74b3bb1 into main Mar 20, 2026
2 checks passed
@javisperez javisperez deleted the sync-docs-to-kitops branch March 20, 2026 20:00
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.

3 participants