Skip to content

Tweaks to the "Commit Built File Changes" workflow#11808

Open
johnbillion wants to merge 5 commits into
WordPress:trunkfrom
johnbillion:commit-built-file-changes-tweaks
Open

Tweaks to the "Commit Built File Changes" workflow#11808
johnbillion wants to merge 5 commits into
WordPress:trunkfrom
johnbillion:commit-built-file-changes-tweaks

Conversation

@johnbillion
Copy link
Copy Markdown
Member

@johnbillion johnbillion commented May 12, 2026

Trac ticket: https://core.trac.wordpress.org/ticket/64227 (for 7.0)
Trac ticket: https://core.trac.wordpress.org/ticket/64893 (for 7.1)

This makes the following changes:

  • Removes the contents: write permission from the GitHub token, it's not needed as the app does the push
  • Removes an unnecessary dance performed with the GH_APP_PRIVATE_KEY environment variable so it's just read directly instead of written to disk
  • Switch to a step output to pass the app token to the next step, which prevents the access token being unnecessarily exposed to subsequent steps
  • Switches to using a repository variable instead of a secret for the app ID, which is not secret (it's 1178653)

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Opus 4.7
Used for: Research and collab

@johnbillion johnbillion marked this pull request as ready for review May 12, 2026 17:58
@johnbillion johnbillion requested review from Copilot and desrosj May 12, 2026 17:58
@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props johnbillion.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

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

This PR updates the “Commit Built File Changes” GitHub Actions workflow to reduce token permissions and secret exposure while keeping the GitHub App installation token as the mechanism used for pushing commits back to PR branches.

Changes:

  • Replaces contents: write on GITHUB_TOKEN with the narrower actions: read permission needed to fetch workflow artifacts.
  • Stops writing the GitHub App private key to disk; uses the secret value directly in the JWT generation step.
  • Passes the GitHub App installation access token via step outputs instead of exporting it to the job environment, and switches the App ID from a secret to a repo variable.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants