Skip to content

Commit 750d06e

Browse files
committed
Don't run Dependency Check unless we are in a PR context. Run the full PHPCS command if we have no PHP files. Update Playground Preview workflow to latest
1 parent 97b0eff commit 750d06e

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/pr-playground-preview.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
6464
- name: Expose built artifact
6565
id: expose
66-
uses: WordPress/action-wp-playground-pr-preview/.github/actions/expose-artifact-on-public-url@c8607529dac8d2bf9a1e8493865fc97cd1c3c87b # v2
66+
uses: WordPress/action-wp-playground-pr-preview/.github/actions/expose-artifact-on-public-url@43fc435558bc6cee69f5b214d6b8ca4f9f80c31d # v3
6767
with:
6868
artifact-name: ${{ steps.pr-metadata.outputs.artifact-name }}
6969
artifact-filename: classifai.zip
@@ -102,7 +102,7 @@ jobs:
102102
ARTIFACT_URL: ${{ steps.expose.outputs.artifact-url }}
103103

104104
- name: Post Playground preview button
105-
uses: WordPress/action-wp-playground-pr-preview@c8607529dac8d2bf9a1e8493865fc97cd1c3c87b # v2
105+
uses: WordPress/action-wp-playground-pr-preview@43fc435558bc6cee69f5b214d6b8ca4f9f80c31d # v3
106106
with:
107107
mode: append-to-description
108108
blueprint: ${{ steps.blueprint.outputs.blueprint }}

.github/workflows/test.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@ jobs:
7373
- name: Run PHPCS
7474
id: phpcs
7575
run: |
76-
HEAD_REF=$(git rev-parse HEAD)
77-
git checkout $HEAD_REF
78-
./vendor/bin/phpcs-changed -s --git --git-base origin/${{ github.base_ref }} ${{ steps.changed-files.outputs.all_changed_files }}
76+
if [[ "${{ steps.changed-files.outputs.any_changed }}" == 'true' && "${{ github.event_name }}" == "pull_request" ]]; then
77+
HEAD_REF=$(git rev-parse HEAD)
78+
git checkout $HEAD_REF
79+
./vendor/bin/phpcs-changed -s --git --git-base origin/${{ github.base_ref }} ${{ steps.changed-files.outputs.all_changed_files }}
80+
elif [[ "${{ github.event_name }}" == "push" ]]; then
81+
composer lint
82+
fi
7983
8084
# Runs the PHP compat coding standards checks.
8185
phpcompat:
@@ -428,6 +432,7 @@ jobs:
428432
# Runs dependency review.
429433
dependency-review:
430434
name: Run dependency review
435+
if: github.event_name == 'pull_request'
431436
runs-on: ubuntu-latest
432437
timeout-minutes: 5
433438
permissions:

0 commit comments

Comments
 (0)