mirror of
https://ghproxy.net/https://github.com/wp-cli/wp-cli-bundle.git
synced 2026-07-21 12:07:40 +08:00
62 lines
2.2 KiB
YAML
62 lines
2.2 KiB
YAML
name: Update wp-cli framework
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
schedule:
|
|
- cron: '17 4 * * *' # Run every day on a seemly random time.
|
|
|
|
# Cancels all previous workflow runs for the same branch that have not yet completed.
|
|
concurrency:
|
|
# The concurrency group contains the workflow name and the branch name.
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
|
|
jobs:
|
|
|
|
update-framework: #----------------------------------------------------------
|
|
name: Update wp-cli framework
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.repository_owner == 'wp-cli' }}
|
|
steps:
|
|
- name: Check out source code
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
|
|
|
|
- name: Set up PHP environment
|
|
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2
|
|
with:
|
|
php-version: 'latest'
|
|
env:
|
|
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Check existence of composer.json file
|
|
id: check_composer_file
|
|
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Install Composer dependencies & cache dependencies
|
|
if: steps.check_composer_file.outputs.files_exists == 'true'
|
|
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4
|
|
env:
|
|
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
|
|
with:
|
|
# Bust the cache at least once a month - output format: YYYY-MM.
|
|
custom-cache-suffix: $(date -u "+%Y-%m")
|
|
|
|
- name: Update wp-cli framework
|
|
run: |
|
|
composer update wp-cli/wp-cli --with-all-dependencies
|
|
|
|
- name: Create pull request
|
|
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8
|
|
with:
|
|
branch: update-framework
|
|
base: ${{ github.event.repository.default_branch }}
|
|
token: ${{ secrets.ACTIONS_BOT }}
|
|
title: Update wp-cli framework
|
|
body: "**This is an automated pull-request**\n\nUpdates the `wp-cli/wp-cli` framework to the latest changeset."
|
|
labels: scope:framework
|
|
commit-message: "Update wp-cli framework"
|