mirror of
https://github.com/graycoreio/github-actions-magento2.git
synced 2026-06-08 19:46:41 +00:00
feat: add fix-magento action (#86)
This commit is contained in:
@@ -17,15 +17,16 @@ Opinionated Github Actions and Workflows to make building, testing, and maintain
|
|||||||
|
|
||||||
## Workflows
|
## 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 |
|
| [Integration Test](./.github/workflows/integration-README.md) | A Github Workflow that runs the Integration Tests of a Magento Package |
|
||||||
|
|
||||||
## Actions
|
## Actions
|
||||||
|
|
||||||
| Action Name | Description |
|
| Action Name | Description |
|
||||||
| ------------------------------------------------ | ------------------------------------------------------------------ |
|
| ------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
|
||||||
| [Unit Test](./unit-test/README.md) | A Github Action that runs the Unit Tests a Magento Package |
|
| [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. |
|
| [Fix Magento Install](./fix-magento-install/README.md) | A Github Action that fixes Magento before `composer install` |
|
||||||
| [Installation Test](./installation-test/README.md) | A Github Action that tests the installability of a Magento Package |
|
| [Get Magento Version](./get-magento-version/README.md) | A Github Action that computes the installed Magento version. |
|
||||||
| [Supported Version](./supported-version/README.md) | A Github Action that computes the currently supported Github Actions Matrix for Magento 2 |
|
| [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 |
|
||||||
@@ -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
|
||||||
|
```
|
||||||
@@ -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"
|
||||||
Reference in New Issue
Block a user