feat: achieve feature parity with Node.js action#38
Closed
DerekRoberts wants to merge 9 commits intomainfrom
Closed
feat: achieve feature parity with Node.js action#38DerekRoberts wants to merge 9 commits intomainfrom
DerekRoberts wants to merge 9 commits intomainfrom
Conversation
- Add triggered output to action.yml for downstream workflow orchestration - Update workflow with matrix testing for trigger behavior verification - Add outputs section to README with practical examples - Replace @main with @x.y.z to enforce proper versioning practices - Use explicit == 'false' conditions for clearer intent - Follow same patterns as Node.js action for consistency
- Use root directory (.) instead of specific frontend/backend dirs - Replace complex Maven commands with simple version check - Focus on testing trigger behavior rather than actual Maven builds - Avoids dependency on specific project structure in test repo
- Remove complex matrix strategy and trigger verification - Keep original simple workflow structure - Just add basic check for triggered output - Focus on core functionality without overengineering
- Check that triggered output exists and is not empty - Validate that output is either 'true' or 'false' - Exit with code 1 if validation fails - Follow same pattern as Node.js action for consistency
- Single check for valid boolean values covers both empty and invalid cases - Empty string would fail the boolean check anyway - Simplified logic while maintaining same validation coverage
- Since we're testing the action itself, it should return true - Simplified check to just verify != 'true' fails the workflow - More precise validation for our specific test scenario
- A passing job is sufficient confirmation that the output works - Just display the output value for visibility - Remove redundant validation logic
- Keep the echo for visibility - Add back the != 'true' check that fails the job - Ensures job fails if output is not working correctly
- Add pattern validation to all inputs for better input validation - Enhance error handling with comprehensive troubleshooting steps - Add workspace ownership reset to prevent permission issues - Match Node.js action functionality for consistent user experience Input validation patterns: - dir: alphanumeric, dots, underscores, slashes, hyphens - java-version: semantic version format - java-cache: maven or gradle - java-distribution: temurin, corretto, openjdk, or zulu - sonar_token: 20+ alphanumeric characters - diff_branch: branch name format - repository: org/repo format - branch: optional branch name format Enhanced error handling includes: - Java/Maven/Gradle specific troubleshooting - Debug information display - Clear error messages with actionable steps Workspace cleanup: - Reset file ownership to prevent permission issues - Consistent with Node.js action behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR brings the Java action to full feature parity with the Node.js action, ensuring consistent functionality and user experience across both actions.
Changes
Input Validation (Pattern Parameters)
^[a-zA-Z0-9._/-]+$- Validates directory paths^[0-9]+(\.[0-9]+)*$- Validates semantic version format^(maven|gradle)$- Validates package manager^(temurin|corretto|openjdk|zulu)$- Validates Java distribution^[a-zA-Z0-9]{20,}$- Validates SonarCloud token format^[a-zA-Z0-9._/-]+$- Validates branch names^[a-zA-Z0-9-_]+/[a-zA-Z0-9-_]+$- Validates org/repo format^[a-zA-Z0-9._/-]*$- Validates optional branch namesEnhanced Error Handling
Workspace Cleanup
Benefits
Testing
The existing workflow will validate these changes:
Related