diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8162095 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,25 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + labels: + - "dependencies" + + - package-ecosystem: "composer" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + labels: + - "dependencies" + + - package-ecosystem: "docker" + directory: "/.devcontainer" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + labels: + - "dependencies" diff --git a/.github/workflows/composer-diff.yml b/.github/workflows/composer-diff.yml index 8dc20e9..1312cdd 100644 --- a/.github/workflows/composer-diff.yml +++ b/.github/workflows/composer-diff.yml @@ -1,25 +1,35 @@ name: Composer Diff + on: pull_request: paths: - 'composer.lock' + +permissions: + contents: read + pull-requests: write + jobs: composer-diff: name: Composer Diff runs-on: ubuntu-latest + timeout-minutes: 5 + concurrency: + group: composer-diff-${{ github.event.pull_request.number }} + cancel-in-progress: true steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v6 with: fetch-depth: 0 # Required to make it possible to compare with PR base branch - name: Generate composer diff id: composer_diff # To reference the output in comment - uses: IonBazan/composer-diff-action@v1 + uses: IonBazan/composer-diff-action@v1.2 - - uses: marocchino/sticky-pull-request-comment@v2 + - uses: marocchino/sticky-pull-request-comment@v3 # An empty diff result will break this action. - if: ${{ steps.composer_diff.outputs.composer_diff_exit_code != 0 }} + if: ${{ github.event.pull_request.head.repo.fork == false && steps.composer_diff.outputs.composer_diff_exit_code != '0' && steps.composer_diff.outputs.composer_diff != '' }} with: header: composer-diff # Creates a collapsed comment with the report message: | diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index 2a0c369..b14e5b3 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -1,19 +1,52 @@ +name: Inspections + on: pull_request -name: Inspections +permissions: + contents: read + jobs: runPHPCSInspection: name: Run PHPCS inspection runs-on: ubuntu-latest + timeout-minutes: 10 + concurrency: + group: phpcs-${{ github.event.pull_request.number }} + cancel-in-progress: true steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - - name: Run PHPCS inspection - uses: rtCamp/action-phpcs-code-review@v3 - env: - GH_BOT_TOKEN: ${{ secrets.GH_BOT_TOKEN }} - SKIP_FOLDERS: "tests,.github" - PHPCS_SNIFFS_EXCLUDE: "WordPress.Files.FileName" - with: - args: "WordPress,WordPress-Core,WordPress-Docs" + - uses: actions/checkout@v6 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + tools: composer + coverage: none + + - name: Install dependencies + run: composer install --no-interaction --no-progress --prefer-dist --no-scripts + + - name: Install cs2pr + run: | + curl -fsSL -o cs2pr https://github.com/staabm/annotate-pull-request-from-checkstyle/releases/latest/download/cs2pr + chmod +x cs2pr + + - name: Run PHPCS inspection + run: | + set +e + ./vendor/bin/phpcs \ + --standard=WordPress,WordPress-Core,WordPress-Docs \ + --ignore=tests/*,.github/* \ + --exclude=WordPress.Files.FileName \ + --report=checkstyle \ + --report-file=phpcs-report.xml \ + src + phpcs_exit=$? + + if [[ -s phpcs-report.xml ]]; then + ./cs2pr < phpcs-report.xml || true + fi + + exit $phpcs_exit diff --git a/src/style.css b/src/style.css index 714db32..b6a3cc4 100644 --- a/src/style.css +++ b/src/style.css @@ -1,9 +1,9 @@ -/* -Theme Name: Avada Child -Description: Child theme for Avada theme. -Author: MHCG LTD -Author URI: https://www.mhcg.co.uk -Template: Avada -Version: 0.1.0 -Text Domain: Avada +/* +Theme Name: Avada Child +Description: Child theme for Avada theme. +Author: MHCG LTD +Author URI: https://www.mhcg.co.uk +Template: Avada +Version: 0.1.0 +Text Domain: Avada */ \ No newline at end of file