Skip to content

Commit ff6d04f

Browse files
authored
Workflow
1 parent a3fc01f commit ff6d04f

File tree

2 files changed

+53
-1
lines changed

2 files changed

+53
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: PHP {{ env.PHP_VERSION }} Compatibility Test Failure
3+
labels: bug, compatibility, automated
4+
assignees:
5+
---
6+
7+
## PHP Compatibility Test Failure
8+
9+
The automated compatibility test for PHP {{ env.PHP_VERSION }} has failed.
10+
11+
### Details
12+
13+
- **PHP Version:** {{ env.PHP_VERSION }}
14+
- **WordPress Version:** Latest
15+
- **Test Date:** {{ date | date('YYYY-MM-DD HH:mm:ss') }}
16+
- **Workflow Run:** [View detailed logs]({{ env.WORKFLOW_URL }})
17+
18+
### Next Steps
19+
20+
This issue has been automatically created because the Simple WP Optimizer plugin failed to load properly with PHP {{ env.PHP_VERSION }}. This could indicate compatibility issues that need to be addressed.
21+
22+
#### Recommended Actions:
23+
24+
1. Review the workflow logs for specific error messages
25+
2. Check for PHP {{ env.PHP_VERSION }} specific syntax or function compatibility issues
26+
3. Test locally with PHP {{ env.PHP_VERSION }} to reproduce the issue
27+
4. Make necessary code updates to ensure compatibility
28+
29+
Once fixed, please close this issue and reference it in the changelog.
30+
31+
---
32+
33+
*This issue was automatically generated by the PHP Compatibility WordPress Test workflow.*

.github/workflows/php-latest-wp-test.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ concurrency:
1515

1616
permissions:
1717
contents: read
18+
issues: write
1819

1920
jobs:
2021
php-compatibility-test:
@@ -298,5 +299,23 @@ jobs:
298299
echo "✅ Tests passed successfully on PHP ${{ matrix.php-version }} with the latest WordPress version"
299300
else
300301
echo "❌ Tests failed on PHP ${{ matrix.php-version }} with the latest WordPress version"
301-
exit 1
302+
# Don't exit here, allow the next step to create the issue
302303
fi
304+
305+
- name: Create issue on test failure
306+
if: ${{ failure() }}
307+
uses: JasonEtco/create-an-issue@v2
308+
env:
309+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
310+
PHP_VERSION: ${{ matrix.php-version }}
311+
RUN_ID: ${{ github.run_id }}
312+
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
313+
with:
314+
filename: .github/ISSUE_TEMPLATE/compatibility-test-failure.md
315+
update_existing: false
316+
317+
- name: Mark job as failed after issue creation
318+
if: ${{ failure() }}
319+
run: |
320+
echo "::error::PHP ${{ matrix.php-version }} compatibility test failed. Created issue for tracking."
321+
exit 1

0 commit comments

Comments
 (0)