Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 2 additions & 63 deletions .github/workflows/reusable-regenerate-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:

- name: Configure git user
run: |
git config --global user.email "info@wp-cli.org"
git config --global user.name "wp-make-coffee"
git config --global user.email "alain.schlesser@gmail.com"
git config --global user.name "Alain Schlesser"
Comment on lines 49 to +52
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow now configures git with a personal name/email. This seems unrelated to the stated revert and will cause automated commits/PRs to be attributed to an individual and exposes a personal email address in workflow history. Consider restoring the previous bot identity (e.g., the wp-cli automation user) for consistency and privacy.

Copilot uses AI. Check for mistakes.
- name: Check if remote branch exists
id: check_remote_branch
Expand All @@ -74,67 +74,6 @@ jobs:
sudo mv wp-cli-nightly.phar /usr/local/bin/wp
sudo chmod +x /usr/local/bin/wp
- name: Check documented commands against registered commands
if: steps.check_composer_file.outputs.files_exists == 'true'
run: |
TYPE=$(jq -r '.type' composer.json)
if [ "$TYPE" != "wp-cli-package" ]; then
echo "Not a wp-cli-package, skipping."
exit 0
fi
DOCUMENTED=$(jq -r '.extra.commands[]?' composer.json)
if [ -z "$DOCUMENTED" ]; then
echo "No extra.commands found in composer.json, skipping."
exit 0
fi
ROOTS=$(echo "$DOCUMENTED" | awk '{print $1}' | sort -u)
if ! DUMP=$(wp cli cmd-dump); then
echo "::error::Failed to dump commands"
exit 1
fi
REGISTERED=$(echo "$DUMP" | jq -r '
def walk_commands(prefix):
(if prefix == "" then .name else prefix + " " + .name end) as $path |
(if $path != "wp" and $path != "" then $path else empty end),
(.subcommands[]? | walk_commands(if $path == "wp" or $path == "" then "" else $path end));
walk_commands("")
')
FOUND_ROOT=0
while IFS= read -r root; do
if echo "$REGISTERED" | grep -qE "^${root}( |$)"; then
FOUND_ROOT=1
break
fi
done <<< "$ROOTS"
if [ "$FOUND_ROOT" -eq 0 ]; then
echo "::error::None of the documented root commands were found in the registered commands. Package commands may have failed to load."
exit 1
fi
MISSING=0
while IFS= read -r cmd; do
ROOT=$(echo "$cmd" | awk '{print $1}')
if echo "$ROOTS" | grep -q "^$ROOT$"; then
if ! echo "$DOCUMENTED" | grep -Fqx "$cmd"; then
echo "::error::Missing command in composer.json: $cmd"
MISSING=1
fi
fi
done <<< "$REGISTERED"
if [ "$MISSING" -eq 1 ]; then
echo "::error::Please update extra.commands in composer.json before regenerating README."
exit 1
fi
echo "All commands correctly documented."
- name: Regenerate README.md file
run: |
wp package install "wp-cli/scaffold-package-command:^2"
Expand Down