From d085f728a798486973811ac5182fe01ef43969b3 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Fri, 4 Aug 2023 15:30:12 +0100 Subject: [PATCH] Update Actions workflows --- .github/workflows/code-style.yml | 31 ------------------------------- .github/workflows/pint-fix.yaml | 29 +++++++++++++++++++++++++++++ .github/workflows/pint-link.yaml | 20 ++++++++++++++++++++ .github/workflows/pr-title.yaml | 13 +++++++++++++ 4 files changed, 62 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/code-style.yml create mode 100644 .github/workflows/pint-fix.yaml create mode 100644 .github/workflows/pint-link.yaml create mode 100644 .github/workflows/pr-title.yaml diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml deleted file mode 100644 index 96a63091..00000000 --- a/.github/workflows/code-style.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Code Style - -on: - push: - branches: - - "5.x" - pull_request: - branches: - - "*" - -permissions: - contents: write - -jobs: - pint: - name: Pint - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Laravel Pint - uses: aglipanci/laravel-pint-action@0.1.0 - with: - preset: laravel - - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Apply Code Style changes diff --git a/.github/workflows/pint-fix.yaml b/.github/workflows/pint-fix.yaml new file mode 100644 index 00000000..f5fe510e --- /dev/null +++ b/.github/workflows/pint-fix.yaml @@ -0,0 +1,29 @@ +name: Fix PHP code style issues + +on: + push: + paths: + - '**.php' + +permissions: + contents: write + +jobs: + fix-php-code-styling: + runs-on: ubuntu-latest + if: github.repository_owner == 'duncanmcclean' + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.PINT }} + + - name: Fix PHP code style issues + uses: aglipanci/laravel-pint-action@1.0.0 + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Fix styling diff --git a/.github/workflows/pint-link.yaml b/.github/workflows/pint-link.yaml new file mode 100644 index 00000000..87a91b0e --- /dev/null +++ b/.github/workflows/pint-link.yaml @@ -0,0 +1,20 @@ +name: Lint PHP code style issues + +on: + pull_request: + paths: + - '**.php' + +jobs: + lint-php-code-styling: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Check PHP code style issues + uses: aglipanci/laravel-pint-action@1.0.0 + with: + testMode: true + verboseMode: true diff --git a/.github/workflows/pr-title.yaml b/.github/workflows/pr-title.yaml new file mode 100644 index 00000000..b365d434 --- /dev/null +++ b/.github/workflows/pr-title.yaml @@ -0,0 +1,13 @@ +name: Pull Request Title + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +jobs: + pr-title: + runs-on: ubuntu-latest + steps: + - uses: deepakputhraya/action-pr-title@master + with: + regex: '^\[\d+\.x\]\s'