Skip to content

Merge pull request #555 from wpengine/copilot/update-nextjs-in-examples #55

Merge pull request #555 from wpengine/copilot/update-nextjs-in-examples

Merge pull request #555 from wpengine/copilot/update-nextjs-in-examples #55

Workflow file for this run

# Runs WordPress Plugin Check on modified plugins to ensure compliance with
# WordPress.org guidelines and coding standards.
#
# https://wordpress.org/plugins/plugin-check/
name: Plugin Check
on:
push:
branches:
- main
paths:
- 'plugins/**'
pull_request:
branches:
- main
paths:
- 'plugins/**'
jobs:
detect-plugins:
runs-on: ubuntu-latest
name: Detect modified plugins
outputs:
plugins: ${{ steps.detect.outputs.plugins }}
has-plugins: ${{ steps.detect.outputs.has-plugins }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get changed plugin directories
id: plugin
run: |
if [ "${{ github.event_name }}" = "push" ]; then
bash .github/scripts/get_plugin_slug.sh main
else
bash .github/scripts/get_plugin_slug.sh \
${{ github.event.pull_request.base.sha }} \
${{ github.event.pull_request.head.sha }}
fi
- name: Set output
id: detect
run: |
# get_plugin_slug.sh outputs: slug, plugins (JSON array), has-plugins
if [ -z "${{ steps.plugin.outputs.slug }}" ]; then
echo "plugins=[]" >> $GITHUB_OUTPUT
echo "has-plugins=false" >> $GITHUB_OUTPUT
exit 0
fi
echo "plugins=${{ steps.plugin.outputs.plugins }}" >> $GITHUB_OUTPUT
echo "has-plugins=${{ steps.plugin.outputs.has-plugins }}" >> $GITHUB_OUTPUT
plugin-check:
needs: detect-plugins
if: needs.detect-plugins.outputs.has-plugins == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
plugin: ${{ fromJson(needs.detect-plugins.outputs.plugins) }}
fail-fast: false
name: ${{ matrix.plugin }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Plugin Check
uses: wordpress/plugin-check-action@v1
with:
build-dir: plugins/${{ matrix.plugin }}
exclude-directories: |
.git
vendor
node_modules
tests
ignore-warnings: true
include-experimental: false