Skip to content

ci: add scheduled workflow to regenerate extensions.json#113

Closed
niels9001 wants to merge 5 commits into
mainfrom
niels9001-scheduled-extensions-regen
Closed

ci: add scheduled workflow to regenerate extensions.json#113
niels9001 wants to merge 5 commits into
mainfrom
niels9001-scheduled-extensions-regen

Conversation

@niels9001

Copy link
Copy Markdown
Contributor

Adds a scheduled workflow (.github/workflows/regenerate-gallery.yml) that keeps extensions.json in sync with the extension manifests.

Behavior

  • Schedule: every 24h at 04:00 UTC, plus manual workflow_dispatch.
  • Regenerates extensions.json via .github/scripts/generate.py.
  • No-noise guard: since generatedAt changes every run, a jq step strips that field and compares old vs new. The run only proceeds when actual gallery content changed.
  • Fully automated cycle: a GitHub App opens the PR, a second bot identity auto-approves it, then auto-merge (squash) completes it. Contributor PRs touching extensions/** are unaffected and still require human moderator review.

Required setup (see PR discussion)

  • vars.GALLERY_BOT_APP_ID + secrets.GALLERY_BOT_PRIVATE_KEY — GitHub App that opens the PR (Contents R/W, Pull requests R/W).
  • secrets.GALLERY_APPROVE_TOKEN — a different identity (second App or bot PAT) that approves the PR. Must differ from the App because the org ruleset enforces require_last_push_approval.

Notes

  • The org disables "Allow GitHub Actions to create and approve pull requests", so the built-in GITHUB_TOKEN can't open PRs — hence the App token, matching the convention used across microsoft-org repos (aspire, fluentui, Docker-Provider, etc.).
  • Auto-approving the bot's own generated-file PR is intentional and scoped only to extensions.json.

niels9001 and others added 5 commits June 25, 2026 17:41
Runs daily (and on demand) to regenerate extensions.json from the
extension manifests and opens a PR when the gallery content changes.
Skips when only the generatedAt timestamp would change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The org disables 'Allow GitHub Actions to create and approve pull
requests', so GITHUB_TOKEN cannot open PRs. Authenticate via a GitHub
App installation token instead.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The org ruleset requires an approving review (with require_last_push_approval),
so a second bot identity approves the app-authored PR before auto-merge
completes it. This makes the scheduled regeneration fully automated while
contributor PRs still require human moderator review.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@niels9001

Copy link
Copy Markdown
Contributor Author

Closing in favor of a Copilot app scheduled workflow that runs the regeneration on a devbox as a maintainer account. That approach avoids the GitHub App / token restrictions this Actions workflow needed. CODEOWNERS (#114) handles reviewer assignment.

@niels9001 niels9001 closed this Jul 12, 2026
@niels9001
niels9001 deleted the niels9001-scheduled-extensions-regen branch July 12, 2026 11:37
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