Skip to content

Use built-in Actions tokens for gallery maintenance - #86

Closed
Jay Gordon (jaydestro) wants to merge 2 commits into
mainfrom
test/copilot-actions-token
Closed

Jay Gordon (jaydestro) wants to merge 2 commits into
mainfrom
test/copilot-actions-token

Conversation

@jaydestro

Copy link
Copy Markdown
Collaborator

Summary

  • authenticate Copilot CLI with the organization-billed built-in GITHUB_TOKEN
  • replace the publisher PAT with job-scoped Actions permissions
  • publish tested proposal branches and compare links for human-created draft PRs, matching enterprise policy
  • use the built-in token to apply authorized review commands to existing maintenance PRs
  • update configuration tests and maintenance documentation

Enterprise policy

The enterprise blocks Actions from creating or approving pull requests. The audit therefore pushes a proposal branch but never creates, approves, or merges a PR. A person opens the emitted compare link and creates the draft PR.

Validation

The smoke test successfully pushed a temporary branch using only job-scoped contents: write; all temporary branches were deleted afterward.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Fix review-command authorization, tighten publication permissions, and align documentation with the manual PR flow.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 2 Low severity

Open (3)
What changed in this PR

Updates gallery maintenance to use built-in Actions tokens, publish proposal branches with compare links, and support human-created draft PRs.

Changes:

  • Replaces PAT authentication with scoped GITHUB_TOKEN usage.
  • Updates workflows, tests, and authentication handling.
  • Revises maintenance documentation and operational guidance.
File Summary
scripts/​gallery-audit/​test/​configuration.test.mjs Updates workflow configuration assertions.
scripts/​gallery-audit/​index.mjs Supports built-in token authentication variables.
docs/​gallery-content-discovery-and-maintenance-proposal.md Documents the token and manual PR flow.
docs/​automated-gallery-maintenance.md Updates setup and maintenance guidance.
.github/​workflows/​audit-gallery-content.yml Uses scoped permissions and publishes proposal branches.
.github/​workflows/​apply-gallery-review.yml Applies review commands with the built-in token.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +22 to +24
permissions:
contents: write
pull-requests: write
```

`gh secret list` confirms only that the names exist. Validate the values by manually running **Audit gallery content**: classification must report `complete`, and an eligible proposal must be able to create or update the draft maintenance pull request.
Validate the configuration by manually running **Audit gallery content**: classification must report `complete`, and an eligible proposal must publish an automation branch and compare link. Open that link and create the draft pull request as a person.
9. apply eligible changes to the per-run automation branch;
10. run focused tests and the full Docusaurus build;
11. open a new draft pull request with a separate write token;
11. publish the proposal branch and a compare link for a person to open as a draft pull request;
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.

2 participants