-
Notifications
You must be signed in to change notification settings - Fork 6
Making reusable-regenerate-readme GitHub-y #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,10 +9,9 @@ concurrency: | |||||||
| group: ${{ github.workflow }}-${{ github.ref }} | ||||||||
| cancel-in-progress: true | ||||||||
|
|
||||||||
|
|
||||||||
| jobs: | ||||||||
|
|
||||||||
| regenerate-readme: #---------------------------------------------------------- | ||||||||
| regenerate-readme: | ||||||||
| name: Regenerate README.md file | ||||||||
| runs-on: ubuntu-latest | ||||||||
| if: ${{ github.repository_owner == 'wp-cli' && ! contains(fromJson('[".github", "wp-cli", "wp-cli-bundle", "wp-super-cache-cli", "php-cli-tools", "wp-config-transformer", "wp-cli.github.com"]'), github.event.repository.name) }} | ||||||||
|
|
@@ -21,51 +20,55 @@ jobs: | |||||||
| uses: actions/checkout@v3 | ||||||||
|
|
||||||||
| - name: Set up PHP envirnoment | ||||||||
|
||||||||
| - name: Set up PHP envirnoment | |
| - name: Set up PHP environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put things in chronological order.
env is prerequisite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Protect shell scripts. Use long options.
Copilot
AI
Nov 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The multi-line string format will introduce unwanted leading whitespace. The command substitution $(date --utc \"+%Y-%m\") will be executed with leading spaces, which could cause issues. Use a plain string instead: custom-cache-suffix: $(date --utc \"+%Y-%m\")
| custom-cache-suffix: | | |
| $(date --utc "+%Y-%m") | |
| custom-cache-suffix: $(date --utc "+%Y-%m") |
Copilot
AI
Nov 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove trailing whitespace after the step definition.
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,12 +11,7 @@ concurrency: | |||||||
|
|
||||||||
| jobs: | ||||||||
|
|
||||||||
| unit: #----------------------------------------------------------------------- | ||||||||
| name: Unit test / PHP ${{ matrix.php }} | ||||||||
| strategy: | ||||||||
| fail-fast: false | ||||||||
| matrix: | ||||||||
| php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] | ||||||||
| has_unit_tests: | ||||||||
| runs-on: ubuntu-20.04 | ||||||||
|
|
||||||||
| steps: | ||||||||
|
|
@@ -29,8 +24,26 @@ jobs: | |||||||
| with: | ||||||||
| files: "composer.json, phpunit.xml.dist" | ||||||||
|
|
||||||||
| outputs: | ||||||||
| exists: ${{ steps.check_files.outputs.files_exists }} | ||||||||
|
|
||||||||
| unit: | ||||||||
| name: Unit tests on PHP ${{ matrix.php }} | ||||||||
| needs: | ||||||||
| - has_unit_tests | ||||||||
| if: ${{ needs.has_unit_tests.outputs.exists == 'true' }} | ||||||||
| strategy: | ||||||||
| fail-fast: false | ||||||||
| matrix: | ||||||||
| php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] | ||||||||
| runs-on: ubuntu-20.04 | ||||||||
|
|
||||||||
| steps: | ||||||||
| - name: Check out source code | ||||||||
| uses: actions/checkout@v3 | ||||||||
|
|
||||||||
| - name: Set up PHP environment (PHP 5.6 - 7.1) | ||||||||
| if: ${{ matrix.php < '7.2' && steps.check_files.outputs.files_exists == 'true'}} | ||||||||
| if: ${{ matrix.php < '7.2' }} | ||||||||
| uses: shivammathur/setup-php@v2 | ||||||||
| with: | ||||||||
| php-version: '${{ matrix.php }}' | ||||||||
|
|
@@ -41,35 +54,52 @@ jobs: | |||||||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||
|
|
||||||||
| - name: Set up PHP environment (PHP 7.2+) | ||||||||
| if: ${{ matrix.php >= '7.2' && steps.check_files.outputs.files_exists == 'true'}} | ||||||||
| if: ${{ matrix.php >= '7.2' }} | ||||||||
| env: | ||||||||
| COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||
| uses: shivammathur/setup-php@v2 | ||||||||
| with: | ||||||||
| php-version: '${{ matrix.php }}' | ||||||||
| coverage: none | ||||||||
| tools: composer,cs2pr | ||||||||
| env: | ||||||||
| COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||
|
|
||||||||
| - name: Install Composer dependencies & cache dependencies | ||||||||
| if: steps.check_files.outputs.files_exists == 'true' | ||||||||
| uses: "ramsey/composer-install@v2" | ||||||||
| env: | ||||||||
| COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }} | ||||||||
| uses: "ramsey/composer-install@v2" | ||||||||
| with: | ||||||||
| # Bust the cache at least once a month - output format: YYYY-MM. | ||||||||
| custom-cache-suffix: $(date -u "+%Y-%m") | ||||||||
| custom-cache-suffix: | | ||||||||
| $(date -u "+%Y-%m") | ||||||||
|
Comment on lines
+72
to
+73
|
||||||||
| custom-cache-suffix: | | |
| $(date -u "+%Y-%m") | |
| custom-cache-suffix: $(date -u "+%Y-%m") |
Copilot
AI
Nov 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The multi-line string format will introduce a leading newline and indentation whitespace that will break the docker options parsing. Docker container options must be a single-line string without leading/trailing whitespace. Keep this as a single-line value.
| options: | | |
| --health-cmd="mysqladmin ping" --health-interval=15s --health-timeout=10s --health-retries=5 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=wp_cli_test --entrypoint sh mysql:${{ matrix.mysql }} -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" | |
| options: --health-cmd="mysqladmin ping" --health-interval=15s --health-timeout=10s --health-retries=5 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=wp_cli_test --entrypoint sh mysql:${{ matrix.mysql }} -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" |
Copilot
AI
Nov 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The multi-line string format will introduce unwanted leading whitespace. The command substitution $(date -u \"+%Y-%m\") will be executed with leading spaces, which could cause issues. Use a plain string instead: custom-cache-suffix: $(date -u \"+%Y-%m\")
| custom-cache-suffix: | | |
| $(date -u "+%Y-%m") | |
| custom-cache-suffix: $(date -u "+%Y-%m") |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may get emotional.
π¨π»βπ¨