DEV Community

Anibal Sanchez
Anibal Sanchez

Posted on

2 1

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

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️