Skip to content

Commit

Permalink
Produce pretty lint results in GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ypcs committed Jun 18, 2024
1 parent b83f878 commit 81ef95f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ RUN ln -s /usr/share/php/PHP/CodeSniffer/bin/phpcs /usr/local/bin/phpcs && \

USER user

ENTRYPOINT ["/usr/bin/php", "/usr/local/bin/phpcs"]
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ build:
$(DOCKER) build -t $(IMAGE) .

run:
$(DOCKER) run --rm -it $(IMAGE)
$(DOCKER) run --rm -it $(IMAGE) --help

11 changes: 11 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh
set -e

# Execute PHPCS

# If we're running in GitHub Actions, do some formatting
if [ -n "${GITHUB_ACTIONS}" ]
/usr/bin/php /usr/local/bin/phpcs --report=checkstyle "$@" |cs2pr
else
/usr/bin/php /usr/local/bin/phpcs "$@"
fi

0 comments on commit 81ef95f

Please sign in to comment.