https://github.com/enomotodev/circleci-composer-update-pr
Create PullRequest of composer update in CircleCI
https://github.com/enomotodev/circleci-composer-update-pr
circleci composer github php
Last synced: 11 months ago
JSON representation
Create PullRequest of composer update in CircleCI
- Host: GitHub
- URL: https://github.com/enomotodev/circleci-composer-update-pr
- Owner: enomotodev
- Created: 2018-08-23T16:27:49.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-29T01:59:58.000Z (almost 7 years ago)
- Last Synced: 2025-04-20T20:08:06.986Z (about 1 year ago)
- Topics: circleci, composer, github, php
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# circleci-composer-update-pr
[](https://packagist.org/packages/enomotodev/circleci-composer-update-pr)
## Installation
```
$ composer require enomotodev/circleci-composer-update-pr
```
## Prerequisites
The application on which you want to run continuous composer update must be configured to be built on CircleCI.
## Usage
### Setting GitHub personal access token to CircleCI
GitHub personal access token is required for sending pull requests to your repository.
1. Go to [your account's settings page](https://github.com/settings/tokens) and generate a personal access token with "repo" scope
1. On CircleCI dashboard, go to your application's "Project Settings" -> "Environment Variables"
1. Add an environment variable `GITHUB_ACCESS_TOKEN` with your GitHub personal access token
### Configure circle.yml
Configure your `circle.yml` or `.circleci/config.yml` to run `circleci-composer-update-pr`, for example:
```yaml
version: 2
jobs:
build:
# snip
continuous_composer_update:
docker:
- image: composer:latest
working_directory: /work
steps:
- run:
name: Set timezone to Asia/Tokyo
command: echo "date.timezone=Asia/Tokyo" > "$PHP_INI_DIR/conf.d/date_timezone.ini"
- checkout
- restore_cache:
name: Restore composer cache
keys:
- composer-{{ .Environment.COMMON_CACHE_KEY }}-{{ checksum "composer.lock" }}
- composer-{{ .Environment.COMMON_CACHE_KEY }}-
- run:
name: Setup requirements for continuous composer update
command: composer global require enomotodev/circleci-composer-update-pr
- deploy:
name: Continuous composer update
command: $COMPOSER_HOME/vendor/bin/circleci-composer-update-pr master
workflows:
version: 2
build:
jobs:
- build:
# snip
nightly:
triggers:
- schedule:
cron: "00 10 * * 5"
filters:
branches:
only: master
jobs:
- continuous_composer_update
```
NOTE: Please make sure you replace `` and `` with yours.
## CLI command references
General usage:
```
$ circleci-compsoser-update-pr
```
## License
circleci-compsoser-update-pr is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)