diff --git a/CHANGELOG.md b/CHANGELOG.md index cd0d802..9f20e67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Security` in case of vulnerabilities +## [1.0.1] - 2025-02-09 + +### Added + +- notice the commit URL + ## [1.0.0] - 2025-02-01 - This GitHub Action automates PHPCS formatting across your project, ensuring consistent code styling by creating a new branch for review when necessary. It simplifies integrating PHPCS/PHPCBF into your workflow. @@ -32,5 +38,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - The new boolean input `stop-on-manual-fix` will cause the workflow to stop (fail) if manual fixes are necessary. (Also stops with an error if some manual fixes are required on top of automatic fixes.) - Cached `vendor/` (for a unique combination of php-version and composer.json) after a successful run in order to speed up further runs. -[Unreleased]: https://github.com/WorkOfStan/phpcs-fix/compare/v1.0.0...HEAD?w=1 +[Unreleased]: https://github.com/WorkOfStan/phpcs-fix/compare/v1.0.1...HEAD?w=1 +[1.0.1]: https://github.com/WorkOfStan/phpcs-fix/compare/v1.0.0...v1.0.1?w=1 [1.0.0]: https://github.com/WorkOfStan/phpcs-fix/releases/tag/v1.0.0 diff --git a/README.md b/README.md index 40988e5..d083228 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ This action can either commit changes directly to the current branch or create a - **Configurable:** Adjust extensions, ignore and standard parameters of phpcs. Adjust PHP version, or commit-message. - **Caching:** Cache `vendor/` (for a unique combination of php-version and composer.json) after a successful run in order to speed up further runs. - **GitHub Action Chain:** Either leave this GitHub Action non-blocking or set `stop-on-manual-fix` according to your automation process needs. +- **Direct link to a new commit:** A URL to the new commit is displayed as a notice to allow for a quick check of what's been changed. ## Usage diff --git a/action.yml b/action.yml index 1a5175b..94f8082 100644 --- a/action.yml +++ b/action.yml @@ -124,12 +124,12 @@ runs: MORE_ISSUES=false vendor/bin/phpcbf --extensions="${{ inputs.extensions }}" . --standard="${{ env.USE_STANDARD }}" --ignore="${{ inputs.ignore }}" || PHPCBF_EXIT_CODE=$? if [ ${PHPCBF_EXIT_CODE} -ne 0 ]; then - echo "::notice title=phpcbf wasn't idle::Non-zero code exit of phpcbf = ${PHPCBF_EXIT_CODE} ... phpcbf wasn't idle" + echo "::notice title=PHPCBF wasn't idle::Non-zero code exit of phpcbf = ${PHPCBF_EXIT_CODE} (phpcbf wasn't idle)" vendor/bin/phpcs --extensions="${{ inputs.extensions }}" . --standard="${{ env.USE_STANDARD }}" --ignore="${{ inputs.ignore }}" || MORE_ISSUES=true # because of `||`, the previous command always exit 0 if [ "${MORE_ISSUES}" = "true" ]; then - echo "::warning title=Some phpcs issues remained.::Some phpcs issues remained. Manual fix necessary." + echo "::warning title=Some PHPCS issues remained.::Some phpcs issues remained. Manual fix necessary." fi fi @@ -138,7 +138,7 @@ runs: # Check for fixable changes if [ -z "$(git status --porcelain)" ]; then - echo "::warning title=No fixable errors were found by phpcbf::No fixable errors were found by phpcbf: Manual fix necessary. Compare to the PHP Code Sniffer section above." + echo "::warning title=No fixable errors were found by PHPCBF::No fixable errors were found by phpcbf: Manual fix necessary. Compare to the PHP Code Sniffer section above." if [ "${{ inputs.stop-on-manual-fix }}" = "true" ]; then # Indicates an error exit 1 @@ -170,7 +170,9 @@ runs: # Commit and push changes with custom message git commit -m "${{ inputs.commit-message }} on $(date +'%Y-%m-%d %H:%M:%S') UTC" git push origin "$BRANCH_NAME" - echo "::notice title=Commit added::$NOTICE_MESSAGE" + echo "::notice title=PHPCBF commit added::${NOTICE_MESSAGE}" + COMMIT_URL=${{ github.server_url }}/${{ github.repository }}/commit/$(git rev-parse HEAD) + echo "::notice title=View the PHPCBF commit::${COMMIT_URL}" # Set branch name as output echo "branch-name=$BRANCH_NAME" >> $GITHUB_OUTPUT