Skip to content

Commit

Permalink
ci: Add a pre-commit reusable workflow with php
Browse files Browse the repository at this point in the history
  • Loading branch information
geokrety-bot committed Aug 8, 2023
1 parent 73cd25d commit a09a6e8
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pre-commit_php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: pre-commit for PHP code

on:
workflow_call:
inputs:
php_version:
type: string
default: "7.4"
php_cd_fixer_version:
type: string
default: "3.22.0"

jobs:
pre-commit:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
steps:
- name: Setup PHP with composer v2
uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php_version }}
tools: composer:v2

- name: Install php-cs-fixer
run: |
curl -L "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v${{ inputs.php_cd_fixer_version }}/php-cs-fixer.phar" -o php-cs-fixer
sudo chmod a+x php-cs-fixer && ls -la $HOME
sudo mv php-cs-fixer /usr/local/bin/
- uses: geokrety/geokrety-gha-workflows/.github/actions/pre-commit@main

0 comments on commit a09a6e8

Please sign in to comment.