Skip to main content
  1. All Posts/

vip-build-tools

Tools Open Source PHP WordPress

VIP Build Tools

A collection of helpful scripts to be used in CI jobs.

Prerequisites

Make sure you have composer installed.

Install

To get setup run the following command in the vip-build-scripts directory:

composer install

Script: Changelog

Extracts changelog information from the last closed Pull Request description and sends a request to a WordPress posts endpoint.

Options

Option
Description
Required / Optional
Default Value

wp-endpoint
The WordPress posts endpoint the changelog will be posted at.
Required

start-marker
The text marker used to find the start of the changelog description inside the PR description.
Optional
<h2>Changelog Description

end-marker
The text marker used to find the end of the changelog description inside the PR description.
Optional
<h2>

wp-status
The WordPress post status.
Optional
draft

wp-tag-ids
A comma separated list of WordPress tag ids to add to the post.
Optional

link-to-pr
Wether or not to include the link to the PR in the post.
Optional
true

Environment Variables

Most of these variables are already built-in by CircleCI.

Option
Description
Required / Optional

CIRCLE_PROJECT_USERNAME
The GitHub username of the current project.
Required

CIRCLE_PROJECT_REPONAME
The name of the repository of the current project.
Required

CHANGELOG_POST_TOKEN
WordPress.com auth token required to post to the endpoint.
Required

GITHUB_TOKEN
The GitHub personal acess token needed to read private repositories.
Optional

  • CHANGELOG_POST_TOKEN can be generated using a helper app like https://github.com/Automattic/node-wpcom-oauth (example instructions)

Usage Example

An example CircleCI Workflow is available here.
The example does NOT have a valid WP TOKEN so no entry will be published.
To run the example you can use circleci-cli: circleci local execute --job create-changelog-draft --config examples/changelog-circleci-config.yml