Skip to content

Fix script injection in lint and release workflows (#118) #1147

Fix script injection in lint and release workflows (#118)

Fix script injection in lint and release workflows (#118) #1147

Workflow file for this run

name: Test
on:
push:
branches:
- '**'
permissions:
contents: read
env:
TERM: xterm-256color
jobs:
php8-compatibility:
name: PHP 8.x Compatibility
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: PHP Compatibility
uses: pantheon-systems/phpcompatibility-action@dev
with:
test-versions: 8.0-
paths: ${{ github.workspace }}/*.php ${{ github.workspace }}/inc/*.php ${{ github.workspace }}/inc/network/*.php
test:
needs: php8-compatibility
name: Test
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.6
strategy:
matrix:
php_version: [7.4, 8.1, 8.3, 8.4, 8.5] # Versions represent newest 7.x, WP supported with exclusions, and beta support.
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Setup PHP
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: ${{ matrix.php_version }}
extensions: mysqli, zip, imagick
- name: Start MySQL
run: sudo systemctl start mysql
- name: Cache dependencies
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/vendor
key: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
restore-keys: test-phpunit-dependencies-${{ hashFiles('composer.json') }}
- name: Install Composer dependencies
run: |
if [ ${{ matrix.php_version }} = "7.4" ]; then
composer require pantheon-systems/pantheon-wp-coding-standards:^2.0 --dev --no-update
composer update
fi
composer install
- name: Install WP-CLI
run: |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
- name: Run PHPUnit
run: bash ./bin/phpunit-test.sh