GithubHelp home page GithubHelp logo

Comments (5)

OskarStark avatar OskarStark commented on July 23, 2024 1

It is part of my composer.json anyway in my projects:

name: "CI"

on: # yamllint disable-line rule:truthy
    pull_request: ~
    push:
        branches:
            - "master"

env:
    DATANA_BOT_EMAIL: "[email protected]"
    DATANA_BOT_NAME: "datana-bot"
    REQUIRED_PHP_EXTENSIONS: "ctype, filter, hash, iconv, imagick"
    PHP_INI_VALUES: "date.timezone=Europe/Berlin"

jobs:
    coding-standards:
        name: "Coding Standards"

        runs-on: "ubuntu-latest"

        strategy:
            matrix:
                php-version:
                    - "8.3"

        steps:
            # workaround for missing secret in fork PRs - see https://github.com/actions/checkout/issues/298
            # see https://github.com/rectorphp/rector/commit/d395e1c28b8e6a56711dcc2e10490a82965850e4
            -   if: github.actor != 'dependabot[bot]'
                name: "Checkout"
                uses: "actions/checkout@v4"
                with:
                    ref: "${{ github.head_ref }}"
                    # Must be used to be able to commit changed files
                    token: "${{ secrets.DATANA_BOT_TOKEN }}"

            # in forks, the token is not available - so we cannot use it
            -   if: github.actor == 'dependabot[bot]'
                name: "Checkout"
                uses: "actions/checkout@v4"
                with:
                    ref: "${{ github.head_ref }}"

            -
                name: "Install PHP with extensions"
                uses: "shivammathur/[email protected]"
                with:
                    coverage: "none"
                    extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
                    php-version: "${{ matrix.php-version }}"
                    ini-values: "${{ env.PHP_INI_VALUES }}"
                    tools: composer:v2

            -
                name: "Validate composer.json"
                run: "composer validate"

            -
                name: "Composer install"
                uses: "ramsey/[email protected]"
                with:
                    composer-options: "--no-scripts"

            -
                name: "Run ergebnis/composer-normalize"
                run: "composer normalize"

            -
                name: "Commit files normalized with ergebnis/composer-normalize"
                uses: "stefanzweifel/[email protected]"
                with:
                    branch: "${{ github.head_ref }}"
                    commit_author: "${{ env.DATANA_BOT_NAME }} <${{ env.DATANA_BOT_EMAIL }}>"
                    commit_message: "Fix: Run 'composer normalize'"
                    commit_user_email: "${{ env.DATANA_BOT_EMAIL }}"
                    commit_user_name: "${{ env.DATANA_BOT_NAME }}"

            -
                name: "Create cache directory for friendsofphp/php-cs-fixer"
                run: "mkdir -p .build/php-cs-fixer"

            -
                name: "Cache cache directory for friendsofphp/php-cs-fixer"
                uses: "actions/cache@v4"
                with:
                    path: ".build/php-cs-fixer"
                    key: "php-${{ matrix.php-version }}-php-cs-fixer-${{ github.sha }}"
                    restore-keys: "php-${{ matrix.php-version }}-php-cs-fixer-"

            -
                name: "Run friendsofphp/php-cs-fixer"
                run: "vendor/bin/php-cs-fixer fix --diff --verbose"

            -
                name: "Commit files fixed with friendsofphp/php-cs-fixer"
                uses: "stefanzweifel/[email protected]"
                with:
                    branch: "${{ github.head_ref }}"
                    commit_author: "${{ env.DATANA_BOT_NAME }} <${{ env.DATANA_BOT_EMAIL }}>"
                    commit_message: "Fix: Run 'php-cs-fixer fix'"
                    commit_user_email: "${{ env.DATANA_BOT_EMAIL }}"
                    commit_user_name: "${{ env.DATANA_BOT_NAME }}"

from php-cs-fixer-ga.

mpdude avatar mpdude commented on July 23, 2024

I've checked how we solve the similar problem over at https://github.com/webfactory/docker-composer-require-checker/blob/main/.github/workflows/build.yml – in fact, we tag the Docker images with the version number of the tool (ComposerRequireChecker) included and omit the "build process" part.

Alternatively, one could tag images with two tags - one for the version of the tool included, and another one like version_of_tool-commit_sha_of_build_repo, for those who want extra scrutinity.

from php-cs-fixer-ga.

OskarStark avatar OskarStark commented on July 23, 2024

Exactly, we need to tag specific versions, but to be honest, I am not using it anymore in my projects.

I would be happy if someone would contribute it or would take a maintainer seat next to me πŸ˜…

Have a good day πŸ‘‹

from php-cs-fixer-ga.

mpdude avatar mpdude commented on July 23, 2024

So what are you using instead?

from php-cs-fixer-ga.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.