Search by

solvebeam / github-actions-toolkit-php

remcotolsma

PHP toolkit for developing GitHub Actions.

Package info

github.com/solvebeam/github-actions-toolkit-php

pkg:composer/solvebeam/github-actions-toolkit-php

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

dev-main 2026-10-11 21:32 UTC

This package is auto-updated.

Last update: 2026-10-11 21:32:57 UTC


README

PHP toolkit for developing GitHub Actions, inspired by the GitHub Actions Toolkit.

Requirements

  • PHP 8.3+
  • Composer

Installation

composer require solvebeam/github-actions-toolkit-php

Usage

use SolveBeam\GitHubActionsToolkit\Core;

$core = new Core();

$core->start_group( 'Install dependencies' );

// …

$core->end_group();

Styling output

use SolveBeam\GitHubActionsToolkit\Style;

$style = new Style();

echo $style->bold( 'Bold' ), PHP_EOL;
echo $style->italic( 'Italic' ), PHP_EOL;
echo $style->underlined( 'Underlined' ), PHP_EOL;
echo $style->cyan( 'Cyan' ), PHP_EOL;
echo $style->command( 'composer install' ), PHP_EOL;

Running commands

use SolveBeam\GitHubActionsToolkit\Core;
use SolveBeam\GitHubActionsToolkit\Shell;

$core  = new Core();
$shell = new Shell();

try {
	$shell->must_run( 'composer install --no-dev' );

	$has_changes = 0 !== $shell->run( 'git diff --quiet' );
} catch ( RuntimeException $e ) {
	$core->set_failed( $e->getMessage() );
}

run() prints and executes the command and returns the result code. must_run() does the same, but throws a RuntimeException if the result code is not 0.

Development

composer install
composer run phpcs
composer run phpstan
composer run rector

License

MIT