Skip to content

Commit 4849abc

Browse files
committed
Merge branch 'main' into copilot/fix-wp-config-mustache-file
2 parents 023b1ac + 4874b18 commit 4849abc

7 files changed

Lines changed: 273 additions & 227 deletions

File tree

‎.github/workflows/copilot-setup-steps.yml‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,29 @@ on:
99
paths:
1010
- .github/workflows/copilot-setup-steps.yml
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
copilot-setup-steps:
17+
name: Setup environment
1418
runs-on: ubuntu-latest
1519
permissions:
1620
contents: read
1721

1822
steps:
1923
- name: Checkout code
2024
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
25+
with:
26+
persist-credentials: false
2127

2228
- name: Check existence of composer.json file
2329
id: check_composer_file
2430
run: echo "files_exists=$(test -f composer.json && echo true || echo false)" >> "$GITHUB_OUTPUT"
2531

2632
- name: Set up PHP environment
2733
if: steps.check_composer_file.outputs.files_exists == 'true'
28-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2
34+
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2
2935
with:
3036
php-version: 'latest'
3137
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
@@ -36,6 +42,6 @@ jobs:
3642

3743
- name: Install Composer dependencies & cache dependencies
3844
if: steps.check_composer_file.outputs.files_exists == 'true'
39-
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # v4
45+
uses: ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda # 4.0.0
4046
env:
4147
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}

‎.github/workflows/deployment.yml‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2020

2121
- name: Set up PHP environment
22-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2
22+
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2
2323
with:
2424
php-version: 'latest'
2525
extensions: mysql, zip, imagick
@@ -49,13 +49,13 @@ jobs:
4949
echo "$CLI_VERSION" > cli_version.txt
5050
5151
- name: Upload WP-CLI version
52-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
52+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
5353
with:
5454
name: cli_version
5555
path: cli_version.txt
5656

5757
- name: Upload manifest file
58-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
58+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
5959
with:
6060
name: manifest
6161
path: vendor/wp-cli/wp-cli/manifest.json
@@ -64,7 +64,7 @@ jobs:
6464
run: php -dphar.readonly=0 utils/make-phar.php wp-cli.phar --version=$CLI_VERSION
6565

6666
- name: Upload built Phar file
67-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
67+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
6868
with:
6969
name: wp-cli-phar
7070
path: wp-cli.phar
@@ -74,7 +74,7 @@ jobs:
7474
strategy:
7575
fail-fast: false
7676
matrix:
77-
php: ['7.2', '7.3', '7.4', '8.5']
77+
php: ['8.5', '7.4']
7878
wp: ['latest']
7979
mysql: ['8.0']
8080
include:
@@ -99,6 +99,9 @@ jobs:
9999
- php: '7.2'
100100
wp: '4.9'
101101
mysql: '5.6'
102+
- php: '7.2'
103+
wp: '6.9'
104+
mysql: '8.0'
102105
runs-on: ubuntu-22.04
103106
env:
104107
WP_CLI_BIN_DIR: /tmp/wp-cli-phar
@@ -115,7 +118,7 @@ jobs:
115118
sudo apt-get install ghostscript -y
116119
117120
- name: Set up PHP environment
118-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2
121+
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2
119122
with:
120123
php-version: '${{ matrix.php }}'
121124
extensions: imagick, mysql, zip
@@ -149,7 +152,7 @@ jobs:
149152
150153
- name: Setup MySQL Server
151154
id: setup-mysql
152-
uses: shogo82148/actions-setup-mysql@840178c12b07a58353c6312be784c23b63756eea # v1
155+
uses: shogo82148/actions-setup-mysql@9c42ca180d5f1dd4dceb54c23c5eda0384f4d265 # v1
153156
with:
154157
mysql-version: ${{ matrix.mysql }}
155158
auto-start: true

‎.github/workflows/update-framework.yml‎

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.ref }}
1616
cancel-in-progress: true
1717

18+
permissions:
19+
contents: write
20+
pull-requests: write
1821

1922
jobs:
2023

@@ -25,9 +28,11 @@ jobs:
2528
steps:
2629
- name: Check out source code
2730
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
31+
with:
32+
token: ${{ secrets.ACTIONS_BOT }}
2833

2934
- name: Set up PHP environment
30-
uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2
35+
uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # v2
3136
with:
3237
php-version: 'latest'
3338
env:
@@ -50,13 +55,36 @@ jobs:
5055
run: |
5156
composer update wp-cli/wp-cli --with-all-dependencies
5257
53-
- name: Create pull request
54-
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8
55-
with:
56-
branch: update-framework
57-
base: ${{ github.event.repository.default_branch }}
58-
token: ${{ secrets.ACTIONS_BOT }}
59-
title: Update wp-cli framework
60-
body: "**This is an automated pull-request**\n\nUpdates the `wp-cli/wp-cli` framework to the latest changeset."
61-
labels: scope:framework
62-
commit-message: "Update wp-cli framework"
58+
- name: Commit and Create Pull Request
59+
env:
60+
GH_TOKEN: ${{ secrets.ACTIONS_BOT }}
61+
PR_BODY: |
62+
**This is an automated pull-request**
63+
64+
Updates the `wp-cli/wp-cli` framework to the latest changeset.
65+
run: |
66+
if [ -n "$(git status --porcelain)" ]; then
67+
git config user.name "github-actions[bot]"
68+
git config user.email "github-actions[bot]@users.noreply.github.com"
69+
git checkout -b update-framework
70+
git add composer.json composer.lock
71+
git commit -m "Update wp-cli framework"
72+
73+
git push -f origin update-framework
74+
75+
PR_NUMBER=$(gh pr list --head update-framework --json number --jq '.[0].number // empty')
76+
if [ -z "$PR_NUMBER" ]; then
77+
gh pr create \
78+
--title "Update wp-cli framework" \
79+
--body "$PR_BODY" \
80+
--label "scope:framework" \
81+
--base "${{ github.event.repository.default_branch }}" \
82+
--head "update-framework"
83+
else
84+
gh pr edit "$PR_NUMBER" \
85+
--title "Update wp-cli framework" \
86+
--body "$PR_BODY" \
87+
--add-label "scope:framework" \
88+
--base "${{ github.event.repository.default_branch }}"
89+
fi
90+
fi

0 commit comments

Comments
 (0)