automattic/vip-build-tools
最新稳定版本:1.3.0
Composer 安装命令:
composer require automattic/vip-build-tools
包简介
A collection of helpful build scripts for the WordPress VIP staff.
README 文档
README
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 | Whether or not to include the link to the PR in the post. | Optional | true |
| changelog-source | Source to create the changelog for. Use last-release to process release notes, otherwise processes last PR |
Optional | |
| wp-terms | Taxonomies and terms to add to the post. E.g. custom_taxonomy_slug:1,2 |
Optional |
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_TOKENcan be generated using a helper app like https://github.com/Automattic/node-wpcom-oauth (example instructions)
Usage Example
GITHUB_TOKEN="" CHANGELOG_POST_TOKEN="" CIRCLE_PROJECT_USERNAME="" CIRCLE_PROJECT_REPONAME="" php scripts/github-changelog.php \
--wp-endpoint=https://example.com/wp-json/wp/v2/posts \
--wp-status=draft \
--wp-categories=3 \
--link-to-pr=true \
--changelog-source=last-release
--wp-terms=custom_taxonomy_slug:1
--wp-terms=tags:4
统计信息
- 总下载量: 5.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-05-07