Skip to content

Commit f6785ca

Browse files
committed
Merge branch 'master' into reduce-repitition
2 parents 4b04a18 + 089bb58 commit f6785ca

File tree

2 files changed

+109
-16
lines changed

2 files changed

+109
-16
lines changed

.env.default

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,54 +12,55 @@
1212
###
1313

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

1717
# Path to the directory where the WordPress develop checkout can be placed and tests can be run.
1818
# When running tests in the same environment, set WPT_TEST_DIR to WPT_PREPARE_DIR
19-
export WPT_TEST_DIR=wp-test-runner
19+
export WPT_TEST_DIR="wp-test-runner"
2020

2121
# API key to authenticate with the reporting service in 'username:password' format.
22-
export WPT_REPORT_API_KEY=
22+
export WPT_REPORT_API_KEY=""
2323

2424
# (Optionally) define an alternate reporting URL
25-
export WPT_REPORT_URL=
25+
export WPT_REPORT_URL=""
2626

2727
# Credentials for a database that can be written to and reset.
2828
# WARNING!!! This database will be destroyed between tests. Only use safe database credentials.
2929
# 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=
30+
export WPT_DB_NAME=""
31+
export WPT_DB_USER=""
32+
export WPT_DB_PASSWORD=""
33+
export WPT_DB_HOST=""
3434

3535
# (Optionally) set a custom table prefix to permit concurrency against the same database.
36-
export WPT_TABLE_PREFIX=${WPT_TABLE_PREFIX-wptests_}
36+
export WPT_TABLE_PREFIX="${WPT_TABLE_PREFIX-wptests_}"
3737

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

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

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

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

5353
# Any options to be passed to the SSH connection
5454
# Defaults to '-o StrictHostKeyChecking=no'
55-
export WPT_SSH_OPTIONS=
55+
export WPT_SSH_OPTIONS=""
5656

5757
# SSH private key, base64 encoded.
58-
export WPT_SSH_PRIVATE_KEY_BASE64=
58+
export WPT_SSH_PRIVATE_KEY_BASE64=""
5959

6060
# Whether to enable debug Mode.
6161
#
62-
# Enabling debug mode will output verbose logging and details about each part of the test runner.
62+
# Enabling debug mode will output verbose logging and details about each part
63+
# of the test runner.
6364
#
6465
# 0 = Debug mode off
6566
# 1 = Debug mode on

.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 }}

0 commit comments

Comments
 (0)