Skip to content

Commit 4225006

Browse files
committed
Merge branch 'master' into documentation-changes
2 parents 0932c1c + 089bb58 commit 4225006

3 files changed

Lines changed: 118 additions & 31 deletions

File tree

.env.default

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,60 +11,55 @@
1111
# $ source .env
1212
###
1313

14-
# Path to the directory where files can be prepared before being delivered to
15-
# the environment.
16-
export WPT_PREPARE_DIR=/tmp/wp-test-runner
14+
# Path to the directory where files can be prepared before being delivered to the environment.
15+
export WPT_PREPARE_DIR="/tmp/wp-test-runner"
1716

18-
# Path to the directory where the WordPress develop checkout can be placed and
19-
# tests can be run. When running tests in the same environment, set WPT_TEST_DIR
20-
# to WPT_PREPARE_DIR
21-
export WPT_TEST_DIR=/tmp/wp-test-runner
17+
# Path to the directory where the WordPress develop checkout can be placed and tests can be run.
18+
# When running tests in the same environment, set WPT_TEST_DIR to WPT_PREPARE_DIR
19+
export WPT_TEST_DIR="wp-test-runner"
2220

23-
# API key to authenticate with the reporting service in 'username:password'
24-
# format.
25-
export WPT_REPORT_API_KEY=
21+
# API key to authenticate with the reporting service in 'username:password' format.
22+
export WPT_REPORT_API_KEY=""
2623

2724
# (Optionally) define an alternate reporting URL
28-
export WPT_REPORT_URL=
25+
export WPT_REPORT_URL=""
2926

3027
# Credentials for a database that can be written to and reset.
31-
# WARNING!!! This database will be destroyed between tests. Only use safe
32-
# database credentials. Please note that you must escape _or_ refrain from
33-
# using # as special character in your credentials.
34-
export WPT_DB_NAME=
35-
export WPT_DB_USER=
36-
export WPT_DB_PASSWORD=
37-
export WPT_DB_HOST=
38-
39-
# (Optionally) set a custom table prefix to permit concurrency against the same
40-
# database.
41-
export WPT_TABLE_PREFIX=${WPT_TABLE_PREFIX-wptests_}
28+
# WARNING!!! This database will be destroyed between tests. Only use safe database credentials.
29+
# Please note that you must escape _or_ refrain from using # as special character in your credentials.
30+
export WPT_DB_NAME=""
31+
export WPT_DB_USER=""
32+
export WPT_DB_PASSWORD=""
33+
export WPT_DB_HOST=""
34+
35+
# (Optionally) set a custom table prefix to permit concurrency against the same database.
36+
export WPT_TABLE_PREFIX="${WPT_TABLE_PREFIX-wptests_}"
4237

4338
# (Optionally) define the PHP executable to be called
44-
export WPT_PHP_EXECUTABLE=${WPT_PHP_EXECUTABLE-php}
39+
export WPT_PHP_EXECUTABLE="${WPT_PHP_EXECUTABLE-php}"
4540

4641
# (Optionally) define the PHPUnit command execution call.
4742
# Use if `php phpunit.phar` can't be called directly for some reason.
48-
export WPT_PHPUNIT_CMD=
43+
export WPT_PHPUNIT_CMD=""
4944

5045
# (Optionally) define the command execution to remove the test directory
5146
# Use if `rm -r` can't be called directly for some reason.
52-
export WPT_RM_TEST_DIR_CMD=
47+
export WPT_RM_TEST_DIR_CMD=""
5348

5449
# SSH connection string (can also be an alias).
5550
# Leave empty if tests are meant to run in the same environment.
56-
export WPT_SSH_CONNECT=
51+
export WPT_SSH_CONNECT=""
5752

5853
# Any options to be passed to the SSH connection
5954
# Defaults to '-o StrictHostKeyChecking=no'
60-
export WPT_SSH_OPTIONS=
55+
export WPT_SSH_OPTIONS=""
6156

6257
# SSH private key, base64 encoded.
63-
export WPT_SSH_PRIVATE_KEY_BASE64=
58+
export WPT_SSH_PRIVATE_KEY_BASE64=""
6459

6560
# Output logging
6661
# Use 'verbose' to increase verbosity
67-
export WPT_DEBUG=
62+
export WPT_DEBUG=""
6863

6964
# Certificate validation
7065
# Use 1 to validate, and 0 to not validate

.github/workflows/props-bot.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Props Bot
2+
3+
on:
4+
# This event runs anytime a PR is (re)opened, updated, marked ready for review, or labeled.
5+
# GitHub does not allow filtering the `labeled` event by a specific label.
6+
# However, the logic below will short-circuit the workflow when the `props-bot` label is not the one being added.
7+
# Note: The pull_request_target event is used instead of pull_request because this workflow needs permission to comment
8+
# on the pull request. Because this event grants extra permissions to `GITHUB_TOKEN`, any code changes within the PR
9+
# should be considered untrusted. See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/.
10+
pull_request_target:
11+
types:
12+
- opened
13+
- synchronize
14+
- reopened
15+
- labeled
16+
- ready_for_review
17+
# This event runs anytime a comment is added or deleted.
18+
# You cannot filter this event for PR comments only.
19+
# However, the logic below does short-circuit the workflow for issues.
20+
issue_comment:
21+
types:
22+
- created
23+
# This event will run everytime a new PR review is initially submitted.
24+
pull_request_review:
25+
types:
26+
- submitted
27+
# This event runs anytime a PR review comment is created or deleted.
28+
pull_request_review_comment:
29+
types:
30+
- created
31+
32+
# Cancels all previous workflow runs for pull requests that have not completed.
33+
concurrency:
34+
# The concurrency group contains the workflow name and the branch name for pull requests
35+
# or the commit hash for any other events.
36+
group: ${{ github.workflow }}-${{ contains( fromJSON( '["pull_request_target", "pull_request_review", "pull_request_review_comment"]' ), github.event_name ) && github.head_ref || github.sha }}
37+
cancel-in-progress: true
38+
39+
# Disable permissions for all available scopes by default.
40+
# Any needed permissions should be configured at the job level.
41+
permissions: {}
42+
43+
jobs:
44+
# Compiles a list of props for a pull request.
45+
#
46+
# Performs the following steps:
47+
# - Collects a list of contributor props and leaves a comment.
48+
# - Removes the props-bot label, if necessary.
49+
props-bot:
50+
name: Generate a list of props
51+
runs-on: ubuntu-24.04
52+
permissions:
53+
# The action needs permission `write` permission for PRs in order to add a comment.
54+
pull-requests: write
55+
contents: read
56+
timeout-minutes: 20
57+
# The job will run when pull requests are open, ready for review and:
58+
#
59+
# - A comment is added to the pull request.
60+
# - A review is created or commented on (unless PR originates from a fork).
61+
# - The pull request is opened, synchronized, marked ready for review, or reopened.
62+
# - The `props-bot` label is added to the pull request.
63+
if: |
64+
(
65+
github.event_name == 'issue_comment' && github.event.issue.pull_request ||
66+
( contains( fromJSON( '["pull_request_review", "pull_request_review_comment"]' ), github.event_name ) && ! github.event.pull_request.head.repo.fork ) ||
67+
github.event_name == 'pull_request_target' && github.event.action != 'labeled' ||
68+
'props-bot' == github.event.label.name
69+
) &&
70+
( ! github.event.pull_request.draft && github.event.pull_request.state == 'open' || ! github.event.issue.draft && github.event.issue.state == 'open' )
71+
72+
steps:
73+
- name: Gather a list of contributors
74+
uses: WordPress/props-bot-action@trunk
75+
with:
76+
format: 'git'
77+
78+
- name: Remove the props-bot label
79+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
80+
if: ${{ github.event.action == 'labeled' && 'props-bot' == github.event.label.name }}
81+
with:
82+
retries: 2
83+
retry-exempt-status-codes: 418
84+
script: |
85+
github.rest.issues.removeLabel({
86+
owner: context.repo.owner,
87+
repo: context.repo.repo,
88+
issue_number: process.env.ISSUE_NUMBER,
89+
name: 'props-bot'
90+
});
91+
env:
92+
ISSUE_NUMBER: ${{ github.event.number }}

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ jobs:
6464

6565
steps:
6666
- name: Checkout repository
67-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
67+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6868

6969
- name: Set up PHP
70-
uses: shivammathur/setup-php@cf4cade2721270509d5b1c766ab3549210a39a2a # v2.33.0
70+
uses: shivammathur/setup-php@20529878ed81ef8e78ddf08b480401e6101a850f # v2.35.3
7171
with:
7272
php-version: '7.4'
7373
coverage: none

0 commit comments

Comments
 (0)