mirror of
https://ghproxy.net/https://github.com/wp-cli/wp-cli-bundle.git
synced 2026-07-21 12:07:40 +08:00
Bumps [shivammathur/setup-php](https://github.com/shivammathur/setup-php) from 2.37.0 to 2.37.1. - [Release notes](https://github.com/shivammathur/setup-php/releases) - [Commits](https://github.com/shivammathur/setup-php/compare/2.37.0...7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc) --- updated-dependencies: - dependency-name: shivammathur/setup-php dependency-version: 2.37.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
90 lines
3.2 KiB
YAML
90 lines
3.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
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
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
|
|
with:
|
|
token: ${{ secrets.ACTIONS_BOT }}
|
|
|
|
- name: Set up PHP environment
|
|
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # 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: Commit and Create Pull Request
|
|
env:
|
|
GH_TOKEN: ${{ secrets.ACTIONS_BOT }}
|
|
PR_BODY: |
|
|
**This is an automated pull-request**
|
|
|
|
Updates the `wp-cli/wp-cli` framework to the latest changeset.
|
|
run: |
|
|
if [ -n "$(git status --porcelain)" ]; then
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
git checkout -b update-framework
|
|
git add composer.json composer.lock
|
|
git commit -m "Update wp-cli framework"
|
|
|
|
git push -f origin update-framework
|
|
|
|
PR_NUMBER=$(gh pr list --head update-framework --json number --jq '.[0].number // empty')
|
|
if [ -z "$PR_NUMBER" ]; then
|
|
gh pr create \
|
|
--title "Update wp-cli framework" \
|
|
--body "$PR_BODY" \
|
|
--label "scope:framework" \
|
|
--base "${{ github.event.repository.default_branch }}" \
|
|
--head "update-framework"
|
|
else
|
|
gh pr edit "$PR_NUMBER" \
|
|
--title "Update wp-cli framework" \
|
|
--body "$PR_BODY" \
|
|
--add-label "scope:framework" \
|
|
--base "${{ github.event.repository.default_branch }}"
|
|
fi
|
|
fi
|