Skip to content
Merged
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
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ Opinionated Github Actions and Workflows to make building, testing, and maintain

## Workflows

| Workflow Name | Description |
| -------------------------------------------------------- | ---------------------------------------------------------------------- |
| Workflow Name | Description |
| ------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [Integration Test](./.github/workflows/integration-README.md) | A Github Workflow that runs the Integration Tests of a Magento Package |

## Actions

| Action Name | Description |
| ------------------------------------------------ | ------------------------------------------------------------------ |
| [Unit Test](./unit-test/README.md) | A Github Action that runs the Unit Tests a Magento Package |
| [Get Magento Version](./get-magento-version/README.md) | A Github Action that computes the installed Magento version. |
| [Installation Test](./installation-test/README.md) | A Github Action that tests the installability of a Magento Package |
| [Supported Version](./supported-version/README.md) | A Github Action that computes the currently supported Github Actions Matrix for Magento 2 |
| Action Name | Description |
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
| [Unit Test](./unit-test/README.md) | A Github Action that runs the Unit Tests a Magento Package |
| [Fix Magento Install](./fix-magento-install/README.md) | A Github Action that fixes Magento before `composer install` |
| [Get Magento Version](./get-magento-version/README.md) | A Github Action that computes the installed Magento version. |
| [Installation Test](./installation-test/README.md) | A Github Action that tests the installability of a Magento Package |
| [Supported Version](./supported-version/README.md) | A Github Action that computes the currently supported Github Actions Matrix for Magento 2 |
32 changes: 32 additions & 0 deletions fix-magento-install/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Fix Magento

A Github Action that fixes Magento before `composer install`.

> You probably only need this action if you're working on a Magento extension. However, if you're working on a Magento store and your CI pipeline breaks, this is probably a good first place to look for corrective measures to take.

## Inputs

See the [action.yml](./action.yml)

## Usage

```yml
name: Fix Magento Install

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
fix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: graycoreio/github-actions-magento2/fix-magento-install@main
with:
magento_directory: path/to/magento
```
48 changes: 48 additions & 0 deletions fix-magento-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Fix Magento Install"
author: "Graycore"
description: "A Github Action that fixes Magento before `composer install`"
inputs:
magento_directory:
required: true
description: "The folder where Magento is installed"

runs:
using: "composite"
steps:
- uses: graycoreio/github-actions-magento2/get-magento-version@main
id: init-magento-get-magento-version
with:
working-directory: ${{ inputs.magento_directory }}

- run: echo "::set-output name=version::$(composer --version | awk '{print $3}')"
shell: bash
name: Compute Composer Version
id: init-magento-get-composer-version

- run: composer require monolog/monolog:"<2.7.0" --no-update
shell: bash
name: Fixup Monolog (https://github.com/magento/magento2/pull/35596)
working-directory: ${{ inputs.magento_directory }}
if: |
steps.init-magento-get-magento-version.outputs.version == '"2.4.4"'

- run: composer require "dotmailer/dotmailer-magento2-extension-package:4.6.0-p2 as 4.6.0" --no-update
shell: bash
name: Fixup Dotmailer (https://devdocs.magento.com/guides/v2.4/release-notes/release-notes-2-4-0-commerce.html#dotdigital-1)
working-directory: ${{ inputs.magento_directory }}
if: |
steps.init-magento-get-magento-version.outputs.version == '"2.4.0"'

- run: |
composer config --no-interaction allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
composer config --no-interaction allow-plugins.laminas/laminas-dependency-plugin true
composer config --no-interaction allow-plugins.magento/* true
name: Fixup Composer Plugins
shell: bash
working-directory: ${{ inputs.magento_directory }}
if: |
!startsWith(steps.init-magento-get-composer-version.outputs.version, 1)

branding:
icon: "code"
color: "green"