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

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay