$ composer require enomotodev/circleci-composer-update-pr
The application on which you want to run continuous composer update must be configured to be built on CircleCI.
GitHub personal access token is required for sending pull requests to your repository.
- Go to your account's settings page and generate a personal access token with "repo" scope
- On CircleCI dashboard, go to your application's "Project Settings" -> "Environment Variables"
- Add an environment variable
GITHUB_ACCESS_TOKEN
with your GitHub personal access token
Configure your circle.yml
or .circleci/config.yml
to run circleci-composer-update-pr
, for example:
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 <username> <email> 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 <username>
and <email>
with yours.
General usage:
$ circleci-compsoser-update-pr <git username> <git email address> <git base branch>
circleci-compsoser-update-pr is open-sourced software licensed under the MIT license