Bump guibranco/github-infisical-secrets-check-action (#178) #410
This file contains 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
name: PHP Linting | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
php-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup PHP runtime | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: "none" | |
- name: Lint PHP files | |
continue-on-error: true | |
id: lint | |
run: | | |
curl -Ls https://github.com/overtrue/phplint/releases/latest/download/phplint.phar -o /usr/local/bin/phplint | |
chmod +x /usr/local/bin/phplint | |
Result=$(/usr/local/bin/phplint --no-cache --no-progress -v -q --exclude=vendor --log-json --ignore-exit-code) | |
Status=$(echo $Result | jq -r ".status") | |
Failures=$(echo $Result | jq -r ".failures") | |
if [ "$Status" == "success" ]; then | |
echo "success=true" >>"$GITHUB_OUTPUT" | |
else | |
echo "success=false" >>"$GITHUB_OUTPUT" | |
{ | |
echo "failures<<EOF" | |
echo -e "$Failures" | |
echo "EOF" | |
} >> "$GITHUB_OUTPUT" | |
fi | |
- name: Update PR with comment (lint succeeded) | |
if: success() && steps.lint.outputs.success == 'true' && github.actor != 'dependabot[bot]' | |
uses: mshick/add-pr-comment@v2 | |
with: | |
refresh-message-position: true | |
message-id: "lint-result" | |
message: | | |
:mag: **Lint summary** | |
:white_check_mark: Lint check passed. | |
- name: Update PR with comment (lint failed) | |
if: failure() && steps.lint.outputs.success == 'false' && github.actor != 'dependabot[bot]' | |
uses: mshick/add-pr-comment@v2 | |
with: | |
refresh-message-position: true | |
message-id: "lint-result" | |
message: | | |
:mag: **Lint summary** | |
:x: The PHP lint check failed. | |
```json | |
${{ steps.lint.outputs.failures }} | |
``` |