fixed missing sanitization #31
Workflow file for this run
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
# Automatically create a release whenever a version-tag is created. | |
name: Create release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
name: Create release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v3 | |
- name: Set up PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
coverage: none | |
tools: composer, cs2pr | |
- name: Get Composer cache directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Set up Composer caching | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-composer-dependencies | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'npm' | |
- name: PHP Syntax check | |
working-directory: ./ | |
run: find . \( -name '*.php' \) -exec php -lf {} \; | |
- name: Set up composer | |
working-directory: ./ | |
run: composer install | |
- name: PHPCS | |
working-directory: ./ | |
run: composer run check-cs | |
- name: Set up node modules | |
working-directory: ./ | |
run: npm ci | |
- name: CSS Lint | |
working-directory: ./ | |
run: npm run lint:css | |
- name: JavaScript Lint | |
working-directory: ./ | |
run: npm run lint:js | |
- name: Create build | |
working-directory: ./ | |
run: npm run build | |
- name: Get changelog entries | |
id: changelog | |
working-directory: ./docs | |
run: | | |
changelog=$(grep -A100 -m1 -e '== Changelog ==' readme.txt) | |
changelog="${changelog//'%'/'%25'}" | |
changelog="${changelog//$'\n'/'%0A'}" | |
changelog="${changelog//$'\r'/'%0D'}" | |
echo $changelog | |
echo "::set-output name=changes::$changelog" | |
- name: Create plugin directory | |
working-directory: ./ | |
run: | | |
mkdir ./string-locator | |
mv ./string-locator.php ./string-locator/ | |
mv ./uninstall.php ./string-locator/ | |
mv docs/changelog.txt ./string-locator/changelog.txt | |
mv docs/readme.txt ./string-locator/readme.txt | |
mv build ./string-locator/ | |
mv includes ./string-locator/ | |
mv views ./string-locator/ | |
- name: Package build | |
working-directory: ./ | |
run: | | |
zip -r string-locator string-locator | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
body: ${{ steps.changelog.outputs.changes }} | |
prerelease: false | |
- name: Upload release build | |
id: upload_release_assets | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./string-locator.zip | |
asset_name: string-locator.zip | |
asset_content_type: application/zip | |
- name: WordPress Plugin Deploy | |
id: wporg-plugin-deploy | |
uses: 10up/action-wordpress-plugin-deploy@stable | |
env: | |
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} | |
SVN_USERNAME: ${{ secrets.SVN_USERNAME }} | |
SLUG: string-locator | |
BUILD_DIR: string-locator |