Skip to content

Commit 338c5f7

Browse files
authored
Direct link to a new commit (#4)
### Added - notice the commit URL
1 parent 11109d3 commit 338c5f7

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1919

2020
### `Security` in case of vulnerabilities
2121

22+
## [1.0.1] - 2025-02-09
23+
24+
### Added
25+
26+
- notice the commit URL
27+
2228
## [1.0.0] - 2025-02-01
2329

2430
- 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
3238
- 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.)
3339
- Cached `vendor/` (for a unique combination of php-version and composer.json) after a successful run in order to speed up further runs.
3440

35-
[Unreleased]: https://github.com/WorkOfStan/phpcs-fix/compare/v1.0.0...HEAD?w=1
41+
[Unreleased]: https://github.com/WorkOfStan/phpcs-fix/compare/v1.0.1...HEAD?w=1
42+
[1.0.1]: https://github.com/WorkOfStan/phpcs-fix/compare/v1.0.0...v1.0.1?w=1
3643
[1.0.0]: https://github.com/WorkOfStan/phpcs-fix/releases/tag/v1.0.0

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This action can either commit changes directly to the current branch or create a
1111
- **Configurable:** Adjust extensions, ignore and standard parameters of phpcs. Adjust PHP version, or commit-message.
1212
- **Caching:** Cache `vendor/` (for a unique combination of php-version and composer.json) after a successful run in order to speed up further runs.
1313
- **GitHub Action Chain:** Either leave this GitHub Action non-blocking or set `stop-on-manual-fix` according to your automation process needs.
14+
- **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.
1415

1516
## Usage
1617

action.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ runs:
124124
MORE_ISSUES=false
125125
vendor/bin/phpcbf --extensions="${{ inputs.extensions }}" . --standard="${{ env.USE_STANDARD }}" --ignore="${{ inputs.ignore }}" || PHPCBF_EXIT_CODE=$?
126126
if [ ${PHPCBF_EXIT_CODE} -ne 0 ]; then
127-
echo "::notice title=phpcbf wasn't idle::Non-zero code exit of phpcbf = ${PHPCBF_EXIT_CODE} ... phpcbf wasn't idle"
127+
echo "::notice title=PHPCBF wasn't idle::Non-zero code exit of phpcbf = ${PHPCBF_EXIT_CODE} (phpcbf wasn't idle)"
128128
129129
vendor/bin/phpcs --extensions="${{ inputs.extensions }}" . --standard="${{ env.USE_STANDARD }}" --ignore="${{ inputs.ignore }}" || MORE_ISSUES=true
130130
# because of `||`, the previous command always exit 0
131131
if [ "${MORE_ISSUES}" = "true" ]; then
132-
echo "::warning title=Some phpcs issues remained.::Some phpcs issues remained. Manual fix necessary."
132+
echo "::warning title=Some PHPCS issues remained.::Some phpcs issues remained. Manual fix necessary."
133133
fi
134134
fi
135135
@@ -138,7 +138,7 @@ runs:
138138
139139
# Check for fixable changes
140140
if [ -z "$(git status --porcelain)" ]; then
141-
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."
141+
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."
142142
if [ "${{ inputs.stop-on-manual-fix }}" = "true" ]; then
143143
# Indicates an error
144144
exit 1
@@ -170,7 +170,9 @@ runs:
170170
# Commit and push changes with custom message
171171
git commit -m "${{ inputs.commit-message }} on $(date +'%Y-%m-%d %H:%M:%S') UTC"
172172
git push origin "$BRANCH_NAME"
173-
echo "::notice title=Commit added::$NOTICE_MESSAGE"
173+
echo "::notice title=PHPCBF commit added::${NOTICE_MESSAGE}"
174+
COMMIT_URL=${{ github.server_url }}/${{ github.repository }}/commit/$(git rev-parse HEAD)
175+
echo "::notice title=View the PHPCBF commit::${COMMIT_URL}"
174176
175177
# Set branch name as output
176178
echo "branch-name=$BRANCH_NAME" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)