Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .docheader
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Symfony Console runtime for Fast Forward shared GitHub Actions automation.
*
* This file is part of fast-forward/github-actions project.
*
* @author Felipe Sayao Lobato Abreu <github@mentordosnerds.com>
* @license https://opensource.org/licenses/MIT MIT License
*
* @see https://github.com/php-fast-forward/github-actions
* @see https://github.com/php-fast-forward/github-actions/issues
* @see https://php-fast-forward.github.io/github-actions/
* @see https://datatracker.ietf.org/doc/html/rfc2119
*/
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{yml,yaml,json,md,rst}]
indent_size = 2

[composer.json]
indent_size = 4
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
* text=auto
/.github/ export-ignore
/docs/ export-ignore
/tests/ export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/composer-dependency-analyser.php export-ignore
/AGENTS.md export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.dev-tools/
.idea/
.phpunit.cache/
.vscode/
backup/
tmp/
vendor/
*.cache
.DS_Store
composer.lock
67 changes: 67 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

declare(strict_types=1);

/**
* Symfony Console runtime for Fast Forward shared GitHub Actions automation.
*
* This file is part of fast-forward/github-actions project.
*
* @author Felipe Sayao Lobato Abreu <github@mentordosnerds.com>
* @license https://opensource.org/licenses/MIT MIT License
*
* @see https://github.com/php-fast-forward/github-actions
* @see https://github.com/php-fast-forward/github-actions/issues
* @see https://php-fast-forward.github.io/github-actions/
* @see https://datatracker.ietf.org/doc/html/rfc2119
*/

require __DIR__ . '/vendor/autoload.php';

use FastForward\DevTools\Path\WorkingProjectPathResolver;
use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$rules = [
'phpdoc_indent' => true,
'phpdoc_order' => [
'order' => ['param', 'return', 'throws'],
],
'phpdoc_separation' => true,
'phpdoc_trim' => true,
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_scalar' => true,
'phpdoc_types' => true,
'phpdoc_to_comment' => false,
'phpdoc_add_missing_param_annotation' => true,
];

$docHeader = __DIR__ . '/.docheader';

if (file_exists($docHeader)) {
$header = file_get_contents($docHeader);

if (is_string($header)) {
$header = preg_replace(
['!^/\*\*\n!', '! \*/!', '! \* ?!', '!%year%!', '!' . date('Y-Y') . '!'],
[null, null, null, date('Y'), date('Y')],
$header
);

$rules['header_comment'] = [
'header' => trim((string) $header),
'comment_type' => 'PHPDoc',
'location' => 'after_declare_strict',
'separate' => 'both',
];
}
}

$finder = Finder::create()
->in([__DIR__])
->exclude(WorkingProjectPathResolver::TOOLING_EXCLUDED_DIRECTORIES);

return (new Config())
->setRiskyAllowed(false)
->setFinder($finder)
->setRules($rules);
35 changes: 35 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# AGENTS - Fast Forward GitHub Actions

This repository contains the Composer-installable command runtime used by Fast
Forward reusable GitHub Actions workflows.

## Repository Surfaces

- CLI entrypoint: [`bin/fast-forward-actions`](bin/fast-forward-actions)
- Console wiring: [`src/Console/`](src/Console/)
- Commands: [`src/Command/`](src/Command/)
- GitHub Actions IO helpers: [`src/GitHub/`](src/GitHub/)
- Project detection logic: [`src/Project/`](src/Project/)
- PHP version resolution logic: [`src/Project/`](src/Project/)
- Tests: [`tests/`](tests/)
- Docs: [`docs/`](docs/)
- Release history: [`CHANGELOG.md`](CHANGELOG.md)

## Setup And Local Workflow

- Install dependencies with `composer install --no-scripts` while workflow
synchronization is still being externalized.
- Use `composer global require fast-forward/github-actions --no-plugins --no-scripts`
when smoke-testing the runtime as a workflow dependency.
- Run tests with `vendor/bin/phpunit`.
- Validate package metadata with `composer validate --strict`.
- Do not add `.github/workflows` in this initial package unless a task explicitly
asks for workflow publication.

## Design Notes

- Keep reusable workflow YAML in `php-fast-forward/.github`.
- Keep this package focused on deterministic commands callable from those
workflows.
- Prefer small services with unit tests over shell fragments embedded in workflow
YAML.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Bootstrap the GitHub Actions console runtime with Symfony Console commands for summaries, changelog release branch parsing, and PHP project surface detection (#1)
- Add a PHP version resolver command for reusable workflow smoke tests (#1)

[unreleased]: https://github.com/php-fast-forward/github-actions/compare/HEAD
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2026 Fast Forward Framework: Code Fast, Deploy Faster!
Copyright (c) 2026 Felipe Sayao Lobato Abreu <github@mentordosnerds.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
42 changes: 40 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,40 @@
# github-actions
Symfony Console runtime for Fast Forward shared GitHub Actions automation.
# Fast Forward GitHub Actions

Symfony Console runtime for Fast Forward reusable GitHub Actions workflows.

This package is intended to move Fast Forward-owned workflow behavior out of
composite-action scripts and into a Composer-installable, testable PHP
application.

## Installation

```bash
composer global require fast-forward/github-actions --no-plugins --no-scripts
```

During early repository work, install local dependencies without running scripts:

```bash
composer install --no-scripts
```

The package depends on `fast-forward/dev-tools`, so reusable workflows can install
this runtime globally even when a consumer repository does not require DevTools
directly. The global install command keeps Composer plugins and scripts disabled
so installing the runtime does not trigger DevTools synchronization.
The DevTools Composer plugin is disabled for this repository, keeping workflow
and agent synchronization out of the first package bootstrap.

## Usage

```bash
fast-forward-actions list
fast-forward-actions php:resolve-version --github-output
fast-forward-actions php:detect-project --github-output
fast-forward-actions changelog:resolve-merged-version release/v0.1.0 --github-output
fast-forward-actions summary:write "## Workflow Summary"
```

This first version intentionally does not add synchronized workflow wrappers.
The organization `.github` repository remains responsible for reusable workflow
YAML while this package grows the command runtime used by those workflows.
37 changes: 37 additions & 0 deletions bin/fast-forward-actions
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env php
<?php

declare(strict_types=1);

/**
* Symfony Console runtime for Fast Forward shared GitHub Actions automation.
*
* This file is part of fast-forward/github-actions project.
*
* @author Felipe Sayao Lobato Abreu <github@mentordosnerds.com>
* @license https://opensource.org/licenses/MIT MIT License
*
* @see https://github.com/php-fast-forward/github-actions
* @see https://github.com/php-fast-forward/github-actions/issues
* @see https://php-fast-forward.github.io/github-actions/
* @see https://datatracker.ietf.org/doc/html/rfc2119
*/

use FastForward\GitHubActions\Console\ConsoleApplicationFactory;

$autoloadCandidates = [
__DIR__ . '/../vendor/autoload.php',
__DIR__ . '/../../../autoload.php',
];

foreach ($autoloadCandidates as $autoloadCandidate) {
if (is_file($autoloadCandidate)) {
require $autoloadCandidate;

exit(ConsoleApplicationFactory::create()->run());
}
}

fwrite(STDERR, "Could not locate Composer autoload.php for fast-forward/github-actions.\n");

exit(1);
27 changes: 27 additions & 0 deletions composer-dependency-analyser.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

/**
* Symfony Console runtime for Fast Forward shared GitHub Actions automation.
*
* This file is part of fast-forward/github-actions project.
*
* @author Felipe Sayao Lobato Abreu <github@mentordosnerds.com>
* @license https://opensource.org/licenses/MIT MIT License
*
* @see https://github.com/php-fast-forward/github-actions
* @see https://github.com/php-fast-forward/github-actions/issues
* @see https://php-fast-forward.github.io/github-actions/
* @see https://datatracker.ietf.org/doc/html/rfc2119
*/

use FastForward\DevTools\Config\ComposerDependencyAnalyserConfig;
use ShipMonk\ComposerDependencyAnalyser\Config\Configuration;
use ShipMonk\ComposerDependencyAnalyser\Config\ErrorType;

return ComposerDependencyAnalyserConfig::configure(
static function (Configuration $configuration): void {
$configuration->ignoreErrorsOnPackage('fast-forward/dev-tools', [ErrorType::UNUSED_DEPENDENCY]);
}
);
89 changes: 89 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"name": "fast-forward/github-actions",
"description": "Symfony Console runtime for Fast Forward shared GitHub Actions automation.",
"license": "MIT",
"type": "library",
"keywords": [
"automation",
"cli",
"fast-forward",
"github-actions",
"symfony-console"
],
"readme": "README.md",
"authors": [
{
"name": "Felipe Sayao Lobato Abreu",
"email": "github@mentordosnerds.com",
"homepage": "https://github.com/coisa",
"role": "Maintainer"
}
],
"homepage": "https://github.com/php-fast-forward/github-actions",
"support": {
"issues": "https://github.com/php-fast-forward/github-actions/issues",
"wiki": "https://github.com/php-fast-forward/github-actions/wiki",
"source": "https://github.com/php-fast-forward/github-actions",
"docs": "https://php-fast-forward.github.io/github-actions/"
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/php-fast-forward"
},
{
"type": "custom",
"url": "https://www.paypal.com/donate/?business=JLDAF45XZ8D84"
}
],
"require": {
"php": "^8.3",
"fast-forward/dev-tools": "^1.24",
"symfony/console": "^7.3 || ^8.0",
"symfony/filesystem": "^7.3 || ^8.0",
"thecodingmachine/safe": "^3.4"
},
"require-dev": {
"phpunit/phpunit": "^12.0 || ^13.0"
},
"minimum-stability": "stable",
"autoload": {
"psr-4": {
"FastForward\\GitHubActions\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"FastForward\\GitHubActions\\Tests\\": "tests/"
}
},
"bin": [
"bin/fast-forward-actions"
],
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true,
"fast-forward/dev-tools": false,
"phpdocumentor/shim": true,
"phpro/grumphp-shim": true,
"pyrech/composer-changelogs": true
},
"platform": {
"php": "8.3.0"
},
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-main": "1.x-dev"
},
"grumphp": {
"config-default-path": "vendor/fast-forward/dev-tools/grumphp.yml"
}
},
"scripts": {
"dev-tools": "dev-tools",
"dev-tools:fix": "@dev-tools --fix",
"test": "phpunit"
}
}
Loading