diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f9de20a..c491209 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -49,7 +49,7 @@ jobs: echo "Composer is not available" exit 1 fi - # PHP Version is equal to 7.4 + # PHP Version is equal to 7.4 if [ "$(php -r 'echo PHP_VERSION_ID;')" -gte 70400 && "$(php -r 'echo PHP_VERSION_ID;')" -lt 70500 ]; then echo "PHP Version is not 7.4. Got $(php -r 'echo PHP_VERSION_ID;') instead of between 70400-70500" exit 1 diff --git a/.github/workflows/trunk.upgrade.yml b/.github/workflows/trunk.upgrade.yml new file mode 100644 index 0000000..7cfc230 --- /dev/null +++ b/.github/workflows/trunk.upgrade.yml @@ -0,0 +1,47 @@ +name: "Quality Control: Trunk Upgrade" + +permissions: read-all + +on: + workflow_call: + workflow_dispatch: + push: + branches: + - main + paths: + - .trunk/trunk.yaml + - .github/workflows/trunk.upgrade.yml + schedule: + - cron: "0 11 * * 1" # 11am Tooling Monday + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + trunk-upgrade: + name: Upgrade Trunk + runs-on: ubuntu-latest + permissions: + contents: write # For trunk to create PRs + pull-requests: write # For trunk to create PRs + steps: + - name: "Setup PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + - name: "Checkout" + uses: actions/checkout@v4 + - name: "Trunk Upgrade" + uses: trunk-io/trunk-action/upgrade@v1 + - name: "PR: Find Pull Request" + uses: juliangruber/find-pull-request-action@v1 + id: find-pull-request + with: + labels: trunk + - name: "PR: Enable Pull Request Automerge" + continue-on-error: true + uses: peter-evans/enable-pull-request-automerge@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + pull-request-number: ${{ steps.find-pull-request.outputs.number }} diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index f88fc1f..318d0ef 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -2,12 +2,12 @@ # To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml version: 0.1 cli: - version: 1.22.1 + version: 1.22.2 # Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins) plugins: sources: - id: trunk - ref: v1.5.0 + ref: v1.6.1 uri: https://github.com/trunk-io/plugins # Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) runtimes: @@ -16,15 +16,19 @@ runtimes: - python@3.10.8 # This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) lint: + ignore: + - linters: [markdownlint] + paths: + - LICENCE.md disabled: - git-diff-check enabled: - - actionlint@1.7.0 - - checkov@3.2.95 - - markdownlint@0.40.0 - - prettier@3.2.5 - - trivy@0.51.1 - - trufflehog@3.76.3 + - actionlint@1.7.1 + - checkov@3.2.216 + - markdownlint@0.41.0 + - prettier@3.3.3 + - trivy@0.54.0 + - trufflehog@3.80.3 - yamllint@1.35.1 actions: enabled: @@ -34,4 +38,4 @@ actions: - trunk-upgrade-available tools: enabled: - - act@0.2.62 + - act@0.2.64 diff --git a/README.md b/README.md index 16e0494..42c0bc7 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,15 @@ Sets up a PHP project with GitHub Actions, including detecting PHP version and r ![Tests Status](https://img.shields.io/github/actions/workflow/status/benzine-framework/action-setup-php/test.yml?logo=github&label=Tests) ![QC Status](https://img.shields.io/github/actions/workflow/status/benzine-framework/action-setup-php/trunk.check.yml?logo=github&label=QC) -## Inputs: +## Inputs - `working_directory`: The directory to run the PHP setup in. Default: `.`. - `php_tools`: The PHP tools to install. -## Outputs: +## Outputs - `php_version`: The PHP version that was detected. -## Exported Envs: +## Exported Envs - `PHP_VERSION`: The PHP version that was detected.