DEV Community

Anibal Sanchez
Anibal Sanchez

Posted on

PHP-Prefixer GitHub Action v1

My Workflow

To facilitate the usage of PHP-Prefixer (an automated online service to apply prefixes to PHP Composer dependencies), the Command-Line provides an ideal tool to integrate the prefixing service in any CI/CD context. As a reference implementation, we support the official GitHub Action for PHP-Prefixer.

Until v0.0.7, we worked with a simple Docker-based action. Now, we've just released the Brand New php-prefixer-build-action v1. It has been completely re-written from scratch following these guidelines:

The new Action combines GitHub Action Checkout and GitHub Action Toolkit. The GitHub Actions ToolKit provides a set of packages to make creating actions more straightforward and robust. The Action does a little bit of everything: clones a repository (with GitHub's checkout), calls the PHP-Prefixer service with a CLI, manages branches and tags, and commits the prefixed results. The final result has been a success so far.

Submission Category:

Maintainer Must-Haves

Yaml File or Link to Code

name: PHP-Prefixer

on: [workflow_dispatch]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Run PHP-Prefixer
        uses: PHP-Prefixer/php-prefixer-build-action@v1.0.0
        with:
          personal_access_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
          project_id: ${{ secrets.PROJECT_ID }}
          token: ${{ secrets.GH_ACCESS_TOKEN }}
Enter fullscreen mode Exit fullscreen mode

Additional Resources / Info

You can check the action usage on this sample project: https://github.com/PHP-Prefixer/hello-wp-world/blob/master/.github/workflows/prefix.yml

Discussion (0)